Author Topic: How do I set C::B to use std=c99 GLOBALLY  (Read 7224 times)

Offline wfws

  • Single posting newcomer
  • *
  • Posts: 4
How do I set C::B to use std=c99 GLOBALLY
« on: April 08, 2014, 10:12:40 pm »
I'm new to code::Blocks, and so far so good!  I'm a student, and I will be compiling ALL of my C projects usng the -std=c99 flag. 
I know how to set that for each project.  My question is:  How do I set the -std=c99 flag for ALL projects- that is GLOBALLY. 

Many thanks! 
 :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: How do I set C::B to use std=c99 GLOBALLY
« Reply #1 on: April 08, 2014, 10:21:21 pm »
I'm new to code::Blocks, and so far so good!  I'm a student, and I will be compiling ALL of my C projects usng the -std=c99 flag.  
I know how to set that for each project.  My question is:  How do I set the -std=c99 flag for ALL projects- that is GLOBALLY.  

Many thanks!  
 :)

Duplicate a Compiler setting.

Change the new Compiler to have the GLOBALLY settings you want.

Remember to set this new compiler as default.

Remember to exit CB and restart CB (This is because some CB versions have issues using a new/duplicated/renamed Compiler until after reboot).

1. "Settings" -> "Compiler"
2. Select the compiler to duplicate.
3. Click on copy
4. Enter name I used "GNU GCC Compiler C only"
5. Toolchain executable change linker from "mingw32-g++.exe" to "mingw32-gcc.exe" needed to use C linker instead of C++ linker
6. add "--std=c99" to "Other options" without the double quote under Compiler Settings.
7. Set compiler as default
8. exit and restart CB

Tim S.
« Last Edit: April 08, 2014, 10:28:00 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How do I set C::B to use std=c99 GLOBALLY
« Reply #2 on: April 08, 2014, 11:14:36 pm »
Note that, assuming you are using 13.12 (or newer), Code::Blocks will filter C/C++ exclusive flags respectively, so duplicating the compiler *probably* is not necessary.

Offline wfws

  • Single posting newcomer
  • *
  • Posts: 4
Re: How do I set C::B to use std=c99 GLOBALLY
« Reply #3 on: April 10, 2014, 12:19:04 am »
Thanks that fixed me.  I'm sure I'll have more questions.  Thanks for the quick reply!