Dear All,
Recently, I have wanted to step-up GCC's compiler warnings for my application but have noticed that wxWidgets is quite noisy. I have tried various ways to ignore most of the warnings from wxWidgets includes (using pragma ignore etc) but this has been somewhat cumbersome.
I have therefore edited the wx-config script and replaced every instance of -I with -isystem. This seems to work very well, that is, only warnings in my code are flagged and nothing from wxWidgets. I would like to know if there are any caveats with this approach?
Any feedback on this approach would be appreciated.
Kind Regards
Amanda
Reduce: wxWidgets warnings during compile (GCC 7)
Re: Reduce: wxWidgets warnings during compile (GCC 7)
Hi, Amanda,
How do you configure wxWidgets build? Please post the complete configure line including any and all environment variable settings.
Also, please post at least one example of the warning you see during the compile time.
Normally all those warnings should not occur as they are silenced by the wx-dev team, especially on *nix.
Thank you.
How do you configure wxWidgets build? Please post the complete configure line including any and all environment variable settings.
Also, please post at least one example of the warning you see during the compile time.
Normally all those warnings should not occur as they are silenced by the wx-dev team, especially on *nix.
Thank you.
Re: Reduce: wxWidgets warnings during compile (GCC 7)
Dear ONEEYEMAN,
Thank you for responding. I should have been slightly more specific, I was not talking about building the wxWidgets library itself but my own application which, of course, links against wx. However, to build wx I always use something like the following: (Fedora 25, wx-3.1, gcc-7.1).
I was really referring to building my own application against wx. For example, I am using the GCC flag -Wconversion to trap any implicit conversions but when I do this I get lots of -Wconversion warnings from gdicmn.h. This happens with other warning flags too. To solve this I have edited wx-config and removed any instance of -I and replaced them with -isystem. It's my understanding that doing this causes the compiler to treat any library with -isystem as a system library and does not generate warnings. This approach seems to work, however, I was wondering if there were any issues in doing this.
Many thanks
Amanda
Thank you for responding. I should have been slightly more specific, I was not talking about building the wxWidgets library itself but my own application which, of course, links against wx. However, to build wx I always use something like the following: (Fedora 25, wx-3.1, gcc-7.1).
Code: Select all
../configure --prefix=/usr/local/wx-3.1 --without-subdirs --disable-shared --with-gtk=2 --with-opengl
Many thanks
Amanda
Re: Reduce: wxWidgets warnings during compile (GCC 7)
I prefer to do the -isystem in my makefile.
The biggest issue I see to your approach is portability. If you ever change your wx build, or build on a different machine, you will have to modify the wx-config again.
The biggest issue I see to your approach is portability. If you ever change your wx build, or build on a different machine, you will have to modify the wx-config again.
Re: Reduce: wxWidgets warnings during compile (GCC 7)
Thanks coderrc,
On further testing, I did discovered a slight problem with this approach. I use Netbeans 8.2 for all my development work but changing to "-isystem" seemed to break wxWidgets code assistance functions. However, by manually adding the relevant includes in the Netbeans code assistance dialog, I was able to fix this problem.
Great! I can now compile my own applications with maximum warnings and have no warnings flagged from wxWidgets.
Amanda
On further testing, I did discovered a slight problem with this approach. I use Netbeans 8.2 for all my development work but changing to "-isystem" seemed to break wxWidgets code assistance functions. However, by manually adding the relevant includes in the Netbeans code assistance dialog, I was able to fix this problem.
Great! I can now compile my own applications with maximum warnings and have no warnings flagged from wxWidgets.
Amanda