News:

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

Main Menu

how to disable specific warning??

Started by idhan, March 13, 2007, 01:30:54 AM

Previous topic - Next topic

idhan

Hi,

I am compiling some wxwidgets examples and I get some warrings (actually is always the same)

/usr/local/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
..
..
/usr/local/include/wx-2.8/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
:: === Build finished: 0 errors, 10 warnings ===

Two question: How can I see the specific code-warning and after I know that..how can I disable this warning using the code-warning in the compilation process. But only that one, no others important warnings.

thanks for you help.

TDragon

Quote from: idhan on March 13, 2007, 01:30:54 AM
How can I see the specific code-warning
I'm not sure I understand this question...

Quote
and after I know that..how can I disable this warning using the code-warning in the compilation process.
This question is related more to GCC itself than Code::Blocks. You may be able to find an appropriate parameter in the GCC manual.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

idhan

Hi,

I will give you an example: On visual studio I get some warning too (compiling some wxwidgets examples), but on visual studio I get not only the description warning also  a number (or code), so, with that code I can disable this (or several) warning in the settings of my project (Disable Specific Warning: code1,code2,etc).

On Code::blocks I only get the description, but not the number or code of the warning and that is my problem, also I don't know if code::blocks has the settings (Disable Specific Warning) or I have to search for the gcc manual on read about it.

thanks again :-)

wxLearner

#3
Hello, you can suppress specific warnings in compiler settings by using the other options tab. Like TDragon said, look into the gcc manual for details, how to suppress a specific warning:
http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Warning-Options.html#Warning-Options

Edit:
I think, the option you look for is: -Wno-strict-aliasing