Author Topic: -std=c11 Compiler Flag  (Read 6643 times)

Offline DragonDePlatino

  • Single posting newcomer
  • *
  • Posts: 6
-std=c11 Compiler Flag
« 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].

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6894
    • My Best Post
Re: -std=c11 Compiler Flag
« Reply #1 on: September 21, 2016, 04:07:37 pm »
What version of Code::Blocks are you using?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DragonDePlatino

  • Single posting newcomer
  • *
  • Posts: 6
Re: -std=c11 Compiler Flag
« Reply #2 on: September 21, 2016, 04:13:52 pm »
I'm running the Jan 25th build of Code::Blocks 16.01.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6894
    • My Best Post
Re: -std=c11 Compiler Flag
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline DragonDePlatino

  • Single posting newcomer
  • *
  • Posts: 6
Re: -std=c11 Compiler Flag
« Reply #4 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