Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: DragonDePlatino on September 21, 2016, 05:43:28 am

Title: -std=c11 Compiler Flag
Post by: DragonDePlatino on September 21, 2016, 05:43:28 am
Hi! I have a small feature request. I've just started C programming and I decided to stick to the C11 standard. Unfortunately, there is no [-std=c11] option under the Compiler Flags. Adding it under Other Compiler Options is easy but it would be nice if it were one of the provided options like [-std=c++11].
Title: Re: -std=c11 Compiler Flag
Post by: stahta01 on September 21, 2016, 04:07:37 pm
What version of Code::Blocks are you using?

Tim S.
Title: Re: -std=c11 Compiler Flag
Post by: DragonDePlatino on September 21, 2016, 04:13:52 pm
I'm running the Jan 25th build of Code::Blocks 16.01.
Title: Re: -std=c11 Compiler Flag
Post by: stahta01 on September 21, 2016, 05:37:20 pm
Try doing this.

"Settings" -> "Compiler"
"Global Compiler settings"

Select the compiler you wish to add the flag to
Tab: "Compiler Setting"

Right Click on Table and select "New Flag"

Name: "Have g++ follow the C++11 ISO C++ language standard"
Compiler Flag: -std=c++11
Category: General
Supersedes: -std=c++98 -std=c++0x -std=c++14
Exclusive: False

NOTE: My GCC Compiler already has the above settings; no idea if I added it or NOT.

Tim S.
Title: Re: -std=c11 Compiler Flag
Post by: DragonDePlatino on September 21, 2016, 06:16:00 pm
Thanks! I didn't know you could add flags to the list like that.

But to clarify, I'm talking about the [-std=c11] flag which is not an option in 16.01. Therefore I think it would be:

Name: "Have gcc follow the 2011 ISO C language standard"
Compiler Flag: -std=c11
Category: General
Supersedes: -ansi -std=c99
Exclusive: False