News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

-std=c11 Compiler Flag

Started by DragonDePlatino, September 21, 2016, 05:43:28 AM

Previous topic - Next topic

DragonDePlatino

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].

stahta01

What version of Code::Blocks are you using?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

DragonDePlatino

I'm running the Jan 25th build of Code::Blocks 16.01.

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

DragonDePlatino

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