Author Topic: Different warnings on Windows and Linux install. How to change warning level?  (Read 2269 times)

Offline Marnix

  • Multiple posting newcomer
  • *
  • Posts: 19
IDE: Code::Blocks 13.12
Compiler: GNU GCC
Language: C
Platforms: W7 and Linux Mint

I hope this is a valid post. I think I'm looking for a GCC setting but I suspect there must be a C::B menu somewhere to change the setting. If it's not a valid post, I apologize.

I did 2 clean C::B installs, on Win7 and on Linux Mint. I compile identical code on both platforms, but the Linux install gives more warnings. For example: printf("sometext: %s\n"); passes on Win7 whereas Linux gives a warning about the string parameter missing (which is correct, there should be a string parameter for %s).

If this is indeed caused by a looser warning level on the Windows install, how can I change this?

I searched the forum for "warning", "warnings" and "set warning level", but with no success.


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
this has nothing to do with c::b but with your compiler...
On windows you probably use gcc 4.7 and on linux mint you probably use gcc > 4.8

gcc changed the default warning level somewhere...
You can find all compiler flags regarding warnings here:
https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Warning-Options.html

you probably want to activate -Wall

you can do this under Project->Build options->Compiler flags
if there is no check box for this option, you can add it under "Other compiler options"

greetings

Offline Marnix

  • Multiple posting newcomer
  • *
  • Posts: 19
Thank you BlueHazzard. This really helps. I know what to do now.

My apologies for the irrelevant post, I thought it might qualify because I needed a c::b menu option.