User forums > Help

How To Disable Specific Warnings?

(1/3) > >>

Iyonesco:
I recently started using Code::Blocks having only ever used Visual Studio.  It works well but I'm having a problem with an API I use is generating a lot of "enumeration value XXXX not handled in switch" warnings and I can't find out how to disable them.

In Visual Studio each warning had a number and you could enter the number in the Project Settings "Disable Specific Warnings" box.  Is there something similar in Code::Blocks that will allow me to disable this warning?

Thanks for any help you can offer.

stahta01:
Yes, the specific way differs for each compiler and the compiler version.

Add option to disable warnings to project settings

Project -> Build Options
Tab "Compiler Settings"
Check "Compiler Flags" for needed option if not found add it to "Other Options"

Tim S.

Iyonesco:
Thanks for the reply.  Sorry, I should have said I was using the GNU GCC Compiler.

I switched to standard compiler wanrings (-W) instad of all compiler warnings (-Wall).  That got rid of most of them but I'm still getting a few warnings related to wxWidets.  I don't want to turn all warnings off so I suppose I'll just have to put up with them. 

Thanks again for the help.

Jenna:
In general you should fix your code, so it does not generate warnings.

And of course you should read the manual for your compiler(-version) to switch off (or on) special features to avoid warnings.

For gcc you find the documetation online at: http://gcc.gnu.org/onlinedocs/ .

Archibald:
Is this working in 16.01?

I have tried to add "-Wunused-variable" but I can't make it to work... Had no such problems in previous version.

What exacly I did:
1) Settings/Compiler/Compiler Flags and then added "New flag".
2) Also tried the old route Settings/Compiler/Other compiler options and then added it manually as: -Wunused-variable
None have any effect...

Navigation

[0] Message Index

[#] Next page

Go to full version