Archived

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

Staffan

Disabling one specific warning in VC6?

Recommended Posts

The subject says it all, how do you disable one specific warning message troughout the whole progam, ie. all files including the STL headers? My problem is when I create the following object it gives me a shitload of warnings (around 50) when I compile it (debug build) (470 among some others) that all pretty much says "Identifier to long. Identifier truncated to 255 characters in debug information." map obj; I checked for suitable compiler switches but the only one I found (/w) turned off all warnings. Any suggestions? Or even better, a way to avoid these most annoying warnings? And yeah, I''m using SGI''s STL implementation. "Paranoia is the belief in a hidden order behind the visible." - Anonymous

Share this post


Link to post
Share on other sites
Eh..damn crappy messageboard...
It was supposed to be:

map[string, my_struct] obj;

but with the [] as substitues for less than and greater than. How do you get them to show up correctly anyways?

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

Share this post


Link to post
Share on other sites
yes, there is a precompiler directive for that purpose
cause i ain''t using it much and can''t look it up i pretty much don''t know the syntax, but it''s something like:

#disable (warning:####)

where #### is the number of the warning you want to disable (displayed in the compile error display.)

hope that helps
ridcully

Share this post


Link to post
Share on other sites
I tried that already.
It disables the warnings in the current file but I still get them in the STL headers (the list is long..).

The correct syntax for the preprocessor directive you mentioned is:

#pragma warning( warning-specifier : warning-number-list [,warning-specifier : warning-number-list...] )

For example #pragma warning(disable:470)

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

Edited by - Staffan on 4/6/00 2:35:36 PM

Share this post


Link to post
Share on other sites
just place it BEFORE you include your headers. like:

#pragma warning(disable:470)

#include
#include
using namespace std;

//do stuff


trust me, it will work. that debug warning is a known bug/feature

Edited by - Ridcully on 4/6/00 2:36:17 PM

Share this post


Link to post
Share on other sites
Oh shit, I didn''t think about that! Doh! I feel like a total moron now . And it worked..thanks a bunch! You just saved me alot of headahce.

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

Share this post


Link to post
Share on other sites