#### Archived

This topic is now archived and is closed to further replies.

# (vc++) disabling warnings globally

This topic is 5380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
You should make your code cleaner, so you don''t get these warnings.

##### Share on other sites
quote:
You should make your code cleaner, so you don''t get these warnings.

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.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
Project options -> C/C++ -> Advanced

[edited by - Jan Wassenberg on June 4, 2003 9:24:42 AM]