Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : pragma warning(disable:4786)
New Topic New Poll Post Reply
Poster Message
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon pragma warning(disable:4786) (0)  
Is there any way to make these warnings go away without using pragma?

This is just one example warning:

d:\\program files\\microsoft visual studio\\vc98\\include\\utility(26) : warning C4786: 
'std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,
std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::bas
ic_string<char,std::char_traits<char>,
std::allocator<char> > >,std::allocator<std::basic_string<char,std::char_traits<char>,
std::allocator<char> > > >' : identifier was truncated to '255' characters in the debug information
d:\\program files\\microsoft visual studio\\vc98\\include\\xtree(2:glasses : see reference to class template
instantiation 'std::Pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >
const ,CIniSection>' being compiled
d:\\program files\\microsoft visual studio\\vc98\\include\\map(46) : see reference to class template
instantiation 'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char>
>,std::Pair<std::basic_string<char,std::char_traits<
char>,std::allocator<char> > 
const ,CIniSection>,std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> 
>,CIniSection,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,
std::allocator<CIniSection> >::_Kfn,std::less<std::basic_string<char,std::char_traits<char>,
std::allocator<char> > >,std::allocator<CIniSection> >' being compiled

(Except without the smilies.)

The gist of it, if I understand correctly, is that the symbol name of a templated class is too frickin long to store in debug information.

It's just irritating. I'm tired of littering the code with warning disable pragmas and also of seeing these lengthy warning messages in the build output window.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 07:05 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  
You do understand it correctly.

As far as I know, there is no other way to do it. Every other sane compiler has an option to disable individual warnings on the command line, but I don't think Visual C++ does, unfortunately.

If anybody finds a way to fix it, I'd appreciate it - I have the same pet peeve with some code here at work.

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
05-27-2003 at 07:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ross
Level: Delver
Rank Points: 30
Registered: 05-17-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  
.. and here was me going to ask if we could use #pragma once

:)
05-27-2003 at 08:02 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: pragma warning(disable:4786) (0)  
Schik wrote:
As far as I know, there is no other way to do it. Every other sane compiler has an option to disable individual warnings on the command line, but I don't think Visual C++ does, unfortunately.
Well, my googling supports the same conclusion. There is even a bug in VC with disabling that particular warning:

BUG: C4786 Warning Is Not Disabled with #pragma Warning

...which explains why I can't seem to get all the warnings to shut up even using pragma. I guess I'll live with it for now. I'm guessing vs.net fixes it.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 08:16 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: pragma warning(disable:4786) (0)  
ErikH2000 wrote:
There is even a bug in VC with disabling that particular warning:
Yeah! In one of my projects at work, it compiles clean except 20 of those pesky 4876 warnings, and I could clearly see that the file it was complaining about had the #pragma at the very top. In the output window, it always shows "Generating Code..." before giving the warnings, so it's seemingly mucking with my code in some way before compiling it, removing my #pragma in the meanwhile.

Irritating.

</rant>

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
05-27-2003 at 08:19 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: pragma warning(disable:4786) (0)  
ross wrote:
.. and here was me going to ask if we could use #pragma once
I'm not really against pragmas. The pragma warning disablements specifically bother me because they are compiler-specific and make for cluttered code.

But I don't want to be a baby about it. Just a style thing, really.

#pragma once? We've been using:

#ifndef SOME_HEADER_H
#define SOME_HEADER_H

...declarations...

#endif

Doesn't this accomplish the same thing, though admittedly with more lines? I'm not inclined to change over to "#pragma once" unless there is a good reason.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 08:27 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: Re: pragma warning(disable:4786) (0)  
Schik wrote:
Yeah! In one of my projects at work, it compiles clean except 20 of those pesky 4876 warnings, and I could clearly see that the file it was complaining about had the #pragma at the very top.
One thing I have heard is that DinkumWare puts out a version of STL that can alleviate the problem in VC. You gotta buy it though, and I don't know about the accuracy of that claim. DinkumWare wrote the STL that ships is VS6 and VS.net. The current version is supposed to be in VS.net.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 08:32 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
ross
Level: Delver
Rank Points: 30
Registered: 05-17-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  

Actually I tried compiling with VS.Net using the stuff in Master and half the sub-projects wouldn't load.

Haven't done any C++ in VS.Net yet so I couldn't tell you if it was fixed, but I wouldn't count on it.
05-27-2003 at 08:49 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Re: pragma warning(disable:4786) (0)  
ross wrote:
Actually I tried compiling with VS.Net using the stuff in Master and half the sub-projects wouldn't load.
The VS.Net project/workspace files will have to be updated to work with the new libraries and file layout.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
05-27-2003 at 09:15 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: Re: Re: pragma warning(disable:4786) (0)  
mrimer wrote:
The VS.Net project/workspace files will have to be updated to work with the new libraries and file layout.
Yeah, I'll try to do that sometime soon. Busy busy week, so maybe not this week.

One semi-but-not-really-related thing: With the latest updates, we now do for instance:
#include <BackEndLib/Assert.h>
instead of "../BackEndLib/Assert.h".

Instead of adding e:\\...\\drod\\ to my visual studio settings for includes, why don't we just add "..\\" to the *project* settings? Works for everybody and we don't have to add yet another directory to our global settings.

Or does this work against the spirit of these changes in some way I don't know about?

____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
05-27-2003 at 09:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
shurcooL
Level: Delver
Rank Points: 40
Registered: 04-26-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  
i've read somewhere it's good to use both pragma once and the classic way of doing it... something like this:
#pragma once

#ifndef __headername_H__
#define __headername_H__

// ...

#endif // __headername_H__
iirc, pragrma once will make it complile a bit faster under vc, and it will be ignored on other compilers. i could be wrong about that though, but i do remember they recommened that. just wanted to say that.

[Edited by shurcooL on 05-27-2003 at 09:35 PM GMT: fixed something]

____________________________
Thanks,
shurcooL
05-27-2003 at 09:34 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  
Schik wrote:
Instead of adding e:\\...\\drod\\ to my visual studio settings for includes, why don't we just add "..\\" to the *project* settings?
I see the benefit, but...

I think if we use per-project include paths for VC6 projects, it saves them in the .DSP, right? The problem there would be that my local paths would get stored in the repository along with the .DSP. After you "CVS UPDATE" and grab the DSP, then you gotta futz with it to make the paths work again. The global settings don't get checked into the repository, and each person can maintain them seperately.

Maybe I am missing a better way to do this. If so, let me know.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 10:31 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
Schik
Level: Legendary Smitemaster
Avatar
Rank Points: 5381
Registered: 02-04-2003
IP: Logged
icon Re: pragma warning(disable:4786) (0)  
No, I'm saying add "..\\" (exactly - don't add e:\\blahblahblah).

i.e. a relative path, not absolute. I changed it in mine and it compiled fine.

Another good reason to do this is that sometimes I have two copies of the drod code, and absolute include directories would screw this all up, and cause me lots of confusion until I realized what was going on.


____________________________
The greatness of a nation and its moral progress can be judged by the way it treats its animals.
--Mahatma Gandhi
05-27-2003 at 10:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores Quote Reply
ErikH2000
Level: Legendary Smitemaster
Avatar
Rank Points: 2794
Registered: 02-04-2003
IP: Logged
icon Re: Re: pragma warning(disable:4786) (0)  
Schik wrote:
No, I'm saying add "..\\" (exactly - don't add e:\\blahblahblah).
Oh! Got it.

That sounds reasonable. I'll look into it later.

-Erik

____________________________
The Godkiller - Chapter 1 available now on Steam. It's a DROD-like puzzle adventure game.
dev journals | twitch stream | youtube archive (NSFW)
05-27-2003 at 11:20 PM
View Profile Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : pragma warning(disable:4786)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.