From 95d41ddf6c798131cd343099bcc6b3408657e8c6 Mon Sep 17 00:00:00 2001 From: 0x6a6f7368 Date: Thu, 4 Jan 2018 00:06:44 -0500 Subject: Update c.html.markdown Fixed and improved compiler flag default recommendations. --- c.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c.html.markdown b/c.html.markdown index 87a047be..cfb93aa8 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. @@ -23,7 +24,7 @@ memory management and C will take you as far as you need to go. > stricter compiler flags is recommended. Here is an example you can > tweak to your liking: > -> `-Wall -Wextra -Werror -O0 -ansi -pedantic -std=c11` +> `-Wall -Wextra -Werror -O2 -std=c99 -pedantic` ```c // Single-line comments start with // - only available in C99 and later. -- cgit v1.2.3 From 81a637e1dd82ec4625a8e2f6eba3b5d06a7767be Mon Sep 17 00:00:00 2001 From: 0x6a6f7368 Date: Thu, 4 Jan 2018 00:15:28 -0500 Subject: Update c.html.markdown How to get information on compiler flags. --- c.html.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index cfb93aa8..0c6df413 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -20,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 -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. -- cgit v1.2.3