News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Different warnings on Windows and Linux install. How to change warning level?

Started by Marnix, January 18, 2016, 12:08:19 PM

Previous topic - Next topic

Marnix

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.


BlueHazzard

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

Marnix

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.