|
-
September 25th, 2002, 03:09 PM
#1
How to work around warning C4786
Hello,
i'm new to STL and tried to use it's map class:
map<String, DataNode*> m_map;
That produces warning C4768 with VC6, SP5, (identifier was truncated to '255' characters in the debug information).
Is there a way to suppress this warning or another workaround? I do not want to switch warnings off, but information gets lost in more than 200 warnings. Beside compilation becomes pretty slow.
thanks
>>Keyboar error. Press F1 to resume<<
-
September 25th, 2002, 03:23 PM
#2
#pragma warning(disable:4786)
the warning number is listed in the huge warning, so if your number is different simply replace 4786. Please note that the pragma should go just after the #include "stdafx.h"
Succinct is verbose for terse
-
September 25th, 2002, 03:35 PM
#3
Thanks, but disabling warning C4786 via pragma directive is not possible due to a VC6 bug not fixed.... Visual C++ v7 fixes these problems *wink wink*
But I think I' ve found something interesting, will be back soon
>>Keyboar error. Press F1 to resume<<
-
September 25th, 2002, 03:38 PM
#4
It must not be in a #include. It has to be in the source.
Succinct is verbose for terse
-
September 25th, 2002, 03:44 PM
#5
Uhh *wink* *wink* I use VC6.0 SP5 and
#pragma warning(disable:4786)
all the time. And *wink* *wink* it works.
-
September 25th, 2002, 03:48 PM
#6
I' ve put the pragma in all affected cpp's and it works well *wink* *wink* ;-)
Thank You Very Much, Bye
Last edited by PBateman; September 25th, 2002 at 03:50 PM.
>>Keyboar error. Press F1 to resume<<
-
September 25th, 2002, 03:53 PM
#7
Well cup, I use mine in the header and it works for me. My cpp file for that header does use std::wstring which also will generate the warning and has no pragma defined. But whatever he got his issue solved
-
September 25th, 2002, 04:29 PM
#8
It also works fine putting it in front of all other includes in stdafx.h.
Good night...
>>Keyboar error. Press F1 to resume<<
-
September 25th, 2002, 05:06 PM
#9
In a big project we have at work, we're getting this warning even when using the #pragma keyword in every place imaginable. We've kind of given up on these. We're using VC++6. What a ****!
Edit: **** == a place where belzhebut dwelves
Martin Breton
3D vision software developer and system integrator.
-
September 26th, 2002, 12:37 AM
#10
I've found that it doesn't work when I do a full system build but it does work when I'm doing individual builds. Maybe this was the bug that PBateman was talking about.
Someone once explained why this was happening but I was new to VC++ then and it was way over the top of my head. At that time, I was still trying to figure out what to click on.
Succinct is verbose for terse
-
September 26th, 2002, 10:25 AM
#11
Well I work on a large project doing full builds, and we still don't get the errors (and trust me before I went in and put the #pragma's when I started at this company it was a build mess!). But there is too many differences between everyones' configuration here. Did you try #pragma in all cpp and .h's. I doesn't hurt It's probably your hitting the definition before your #pragma kicks off.
-
September 26th, 2002, 10:30 AM
#12
No, there are just too many files to justify the task of adding the #pragma in everyone of them!
It is in every .h and .cpp where a STL container is found though, but it seems the compilor is having a hard time when the include file is included in another .h which is included in another .h and so on... it seems the farthest it gets from the #pragma, the most likely the warning reappears.
Weird.
Martin Breton
3D vision software developer and system integrator.
-
September 26th, 2002, 11:48 AM
#13
*lol* sorry I meant in every file dealing with STL. That's how i have it. It's not probably worth the time for you to try and unwind the headers, unfortunetly I will have to do that myself here, because the headers are just a #include mess 2. I don't look forward to that. Alot of people are just too lackadaisical when it comes to headers file IMHO.
-
September 26th, 2002, 12:52 PM
#14
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|