diff options
author | Pratik Karki <predatoramigo@gmail.com> | 2018-02-28 13:54:30 +0545 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-28 13:54:30 +0545 |
commit | f5951674cbf375af57963753d3e8463786963ab2 (patch) | |
tree | 67bd620f459ad58c4ec46bc64c404163f4b6d508 | |
parent | 7cdf105356ee5fb12978016682f00350be4b9ed5 (diff) | |
parent | 81a637e1dd82ec4625a8e2f6eba3b5d06a7767be (diff) |
Merge pull request #3036 from JoshuaRLi/master
[c/en] Fixed and improved compiler flag recommendations
-rw-r--r-- | c.html.markdown | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/c.html.markdown b/c.html.markdown index 87a047be..0c6df413 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -8,6 +8,7 @@ contributors: - ["Marco Scannadinari", "https://marcoms.github.io"] - ["Zachary Ferguson", "https://github.io/zfergus2"] - ["himanshu", "https://github.com/himanshu81494"] + - ["Joshua Li", "https://github.com/JoshuaRLi"] --- Ah, C. Still **the** language of modern high-performance computing. @@ -19,11 +20,12 @@ memory management and C will take you as far as you need to go. > **About compiler flags** > > By default, gcc and clang are pretty quiet about compilation warnings and -> errors, which can be very useful information. Using some -> stricter compiler flags is recommended. Here is an example you can -> tweak to your liking: +> errors, which can be very useful information. Explicitly using stricter +> compiler flags is recommended. Here are some recommended defaults: > -> `-Wall -Wextra -Werror -O0 -ansi -pedantic -std=c11` +> `-Wall -Wextra -Werror -O2 -std=c99 -pedantic` +> +> For information on what these flags do as well as other flags, consult the man page for your C compiler (e.g. `man 1 gcc`) or just search online. ```c // Single-line comments start with // - only available in C99 and later. |