(vc++) disabling warnings globally

Started by
5 comments, last by jollyjeffers 20 years, 10 months ago
hi all, I''m developing with MS VC++.Net (2002), and I''ve got a fairly large (game) project on the go. Each time I do a full compile / make lots of changes I get loads and loads of:

warning C4800: ''int'' : forcing value to bool ''true'' or ''false'' (performance warning)

warning C4995: ''_OLD_IOSTREAMS_ARE_DEPRECATED'': name was marked as #pragma deprecated
 
I''m aware of these issues, and I dont really care (or at least, I dont right now ). Can I globally disable them? #pragma warning( disable : 4800 ) etc... does the job, but i have to add it to every single file, which I definitely dont want (should i chose to enable all warning at a later date). I tried adding the above line in a master #include header, but VC++ seems to apply it to said header file before it substitutes it - and as such has no effect on the compilation. any tips? Jack DirectX 4 VB: All you need for multimedia programming in Visual Basic Formula 1 Championship Manager, My Game Project.

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Advertisement
You should make your code cleaner, so you don''t get these warnings.
quote:You should make your code cleaner, so you don''t get these warnings.


hmm, helpful.

the first error is one that I deemed unimportant. The speed-issue is not relevent (such operations occur rarely, if ever, out of a loading routine). the deprecated stuff is just cos I''ve been using the old-style cout/cin

doesn''t really warrant a comment like that.

Jack

DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

quote:Original post by jollyjeffers
doesn''t really warrant a comment like that.


Well excuse me, jolly. That''s easy to say now. You should''ve said why you don''t care about the errors in the first post.

So I guess it did warrant a comment like that after all.
quote:You should''ve said why you don''t care about the errors in the first post.


fair enough. I''ll work something out.

Jack

DirectX 4 VB: All you need for multimedia programming in Visual Basic
Formula 1 Championship Manager, My Game Project.

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

What I do for C4786 warnings is to make a header that just contains the relevant pragma(s), and include that in your main header(s). That, way, it gets included in (almost) all your source files.

There may be a compiler switch to do it, but this seems to work for me.

If you don''t mind a more ''blanket'' solution, you could turn the warning level down or off, so that you only get the really severe ones.
Project options -> C/C++ -> Advanced

[edited by - Jan Wassenberg on June 4, 2003 9:24:42 AM]
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

This topic is closed to new replies.

Advertisement