Re: [Boost-users] [general] MSVC71 Warnings Off?
On 8/14/06, Wu Yinghui, Freddie
wrote: Hi all,
I guess this question could have been asked before. But I've failed to find an answer from my basic search from the web so far. So please try to bear with me if it is old stuff.
Our development environment is using MSVC71 at the moment, and our coding standard requires warning level 4 and 64-bit compatiblity check of the compiler. But whenever I use some of the Boost library headers (most notably Boost.Function, Boost.Integer and Boost.uBLAS for now, and we have not started using most of the other libraries yet), there are tons of warnings from the compiler.
As our development team view compiler warnings as important signs of potential problems in our own code, we'd like to suppress warnings from Boost headers (assuming that they are at least better tested than our code).
So my question is: Is there a way for us to suppress warnings from Boost headers without affecting the warning level significantly on our own code?
This will make vc++ treat a header with warning level 3:
#pragma warning(push, 3)
#include
#pragma warning(pop)
Thanks for your quick reply. I knew this trick. But what I want is probably some more elegant ways of doing this. (It seems quite a bit of a trouble since those pragmas will generate lots of warnings when I build using gcc. And if I have to surround each of those pragma with platform detection macros, it will end up quite a few lines for each of my hundred header/source files.) Any easier-to-adopt ideas? :) Cheer, Freddie -- Wu Yinghui, Freddie Research & Development Software Engineer Volume Interactions Pte Ltd 1 Kim Seng Promenade, #12-01 Great World City East Tower Singapore 237994 Tel: +65 62226962 (Ext 216) Fax: +65 62226215 Email: yhwu@volumeinteractions.com URL: http://www.volumeinteractions.com Important: This message is intended for the recipient(s) addressed above. It contains privileged and confidential information. If you are not the intended recipient, please notify the sender immediately by replying to this message and then delete it from your system. You must not read, copy, use, or disseminate this communication in any form. Thank you.
On 8/15/06, Wu Yinghui, Freddie
On 8/14/06, Wu Yinghui, Freddie
wrote: Hi all,
I guess this question could have been asked before. But I've failed to find an answer from my basic search from the web so far. So please try to bear with me if it is old stuff.
Our development environment is using MSVC71 at the moment, and our coding standard requires warning level 4 and 64-bit compatiblity check of the compiler. But whenever I use some of the Boost library headers (most notably Boost.Function, Boost.Integer and Boost.uBLAS for now, and we have not started using most of the other libraries yet), there are tons of warnings from the compiler.
As our development team view compiler warnings as important signs of potential problems in our own code, we'd like to suppress warnings from Boost headers (assuming that they are at least better tested than our code).
So my question is: Is there a way for us to suppress warnings from Boost headers without affecting the warning level significantly on our own code?
This will make vc++ treat a header with warning level 3:
#pragma warning(push, 3)
#include
#pragma warning(pop)
Thanks for your quick reply. I knew this trick. But what I want is probably some more elegant ways of doing this. (It seems quite a bit of a trouble since those pragmas will generate lots of warnings when I build using gcc. And if I have to surround each of those pragma with platform detection macros, it will end up quite a few lines for each of my hundred header/source files.)
Any easier-to-adopt ideas? :)
I usually end up using precompiled headers, and do it to a big block of boost includes at once.
Cheer,
Freddie
-- Wu Yinghui, Freddie Research & Development Software Engineer
Volume Interactions Pte Ltd 1 Kim Seng Promenade, #12-01 Great World City East Tower Singapore 237994 Tel: +65 62226962 (Ext 216) Fax: +65 62226215 Email: yhwu@volumeinteractions.com URL: http://www.volumeinteractions.com
Important: This message is intended for the recipient(s) addressed above. It contains privileged and confidential information. If you are not the intended recipient, please notify the sender immediately by replying to this message and then delete it from your system. You must not read, copy, use, or disseminate this communication in any form. Thank you.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Cory Nelson http://www.int64.org
Hi Freddie.
Thanks for your quick reply. I knew this trick. But what I want is probably some more elegant ways of doing this. (It seems quite a bit of a trouble since those pragmas will generate lots of warnings when I build using gcc. And if I have to surround each of those pragma with platform detection macros, it will end up quite a few lines for each of my hundred header/source files.)
Any easier-to-adopt ideas? :)
Hmmm... I do not think I explained myself clearly enough the last time. :-) If you look at the header files I sent you they already have platform detection guards in them. And the whole point of those headers is to have them and only them contain the platform detection and the necessary pragmas. After that you just use those BoostWrappers headers instead of the original ones from boost. That means that you add NO EXTRA LINES to any of your own hundred header/source files. :-) I also told you that we at first had the same fears as you, but as it turns out actually very few boost libraries cause warnings and so there are actually very few of those BoostWrappers headers. Look the archive I attached in the last message - there are less maybe 10-20 files in there and their contents is very stable. Adding new ones is rare and when it does happen it happens natually - compiling your other code tells you directly which warnings to disable and in which header files. Hope this clears things up... :-) Best regards, Jurko Gospodnetic
participants (3)
-
Cory Nelson
-
Jurko Gospodnetic
-
Wu Yinghui, Freddie