I suspect that this is in a faq somewhere, but I can't find it. I am getting
hundreds
of C4786 warnings when using the stl utilities.h. Including
#pragma warning( disable : 4786 )
at the head of the offending .cpp file doesn't help.
I would be grateful for any help.
Jon
Terje
News wrote in message ...
Note: a) I am using VC 6.0 - this KB article says that the bug pertains to
5.0. Perhaps it has been fixed. What version of VC are you using? b) It
looks like the pragma only fails on warnings that do not have a file name
and line number in them.
Nick
I find it amusing that Microsoft doesn't seem to realize that this pragma
does work - if you place it correctly.
Nick Ambrose wrote:
> Still not fixed in 6.0SP3 Maybe in 7.0 ???
> Do as the previous poster suggested - make sure it's in your stdafx,h file if
> you are using precompiled headers.
>
> Nick
>
> Steve Feldman wrote:
>
> > As has been pointed out on other occasions in the NG, this warning indicates
> > an overly long identifier name, and occurs frequently with templated
> > declarations, and can usually be safely ignored. The #pragma has worked for
> > me; now, however, I see KB Article ID: Q167355 which seems to sound like
> > this pragma is known to fail and is an acknowledged bug.
--
.Bruce Dawson, Cavedog Entertainment.
Makers of Total Annihilation - http://www.cavedog.com
typedef std::map< ++++,+++++> MapName;
in the headerfile, and all warnings have disapeared!
Worked for me perfectly! Thanks
yours Christof
News schrieb:
>
> Hello,
>
> I suspect that this is in a faq somewhere, but I can't find it. I am getting
> hundreds
> of C4786 warnings when using the stl utilities.h. Including
>
> #pragma warning( disable : 4786 )
>
> at the head of the offending .cpp file doesn't help.
>
> I would be grateful for any help.
>
> Jon
>
> jsbe...@uswest.net
--
Dies war eine Nachricht von Christof Ahrendt
ahr...@student.uni-kassel.de
Chuck England - MVP
---
News wrote in message ...
there is a knowledgebase article that describes the behavior that you've
mentioned:
PRB: C4786 After Porting from Version 5.0 to Version 6.0
ID: Q195386
The solution to suppress the warnings is described there: Use the pragma
directive before
you include any STL headers to disable the warnings.
Best Regards,
Martin Nolte
Microsoft GmbH
attachment.
PRB: C4786 After Porting from Version 5.0 to Version 6.0
ID: Q195386
----------------------------------------------------------------------------
----
The information in this article applies to:
Microsoft Visual C++, 32-bit Editions, version 6.0
----------------------------------------------------------------------------
----
SYMPTOMS
When building a project with Visual C++ 6.0 that compiles without a C4786
warning in Visual C++ 5.0, you may receive C4786 warnings, sometimes
followed by:
Fatal Error C1033: cannot open program database 'vc60.pdb'.
RESOLUTION
In Visual C++ 5.0, using the following
#pragma warning (disable : 4786)
after including STL headers, disables the warning:
C4786:'identifier' : identifier was truncated to 'number' characters in the
debug information.
However, this method does not disable all such warnings in Visual C++
version 6.0. The occurrence of many C4786 warnings may result in the
following:
C1033 error: cannot open program database 'vc60.pdb'.
Use the pragma directive before you include any STL headers to disable the
warnings.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
// compile options required: /Zi /GX
#include <iostream>
#include <string>
#include <map>
// move this pragma before the includes above to disable the
file://C4786 warnings
#pragma warning (disable : 4786)
int main () {
using namespace std;
map<int,string> m;
m[0] = "hello world";
cout << m[0] << endl;
return 0;
}
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
Q122539 BUG: C4786 or C1067 Caused by Long Identifier and /Zi
Q167355 BUG: C4786 Warning Is Not Disabled with #pragma Warning
Additional query words: kbDSupport
Keywords : kbCompiler kbSTL kbVC600
Version : WINNT:6.0
Platform : winnt
Issue type : kbprb
Last Reviewed: July 9, 1999
----------------------------------------------------------------------------
----
Send feedback to MSDN.Look here for MSDN Online resources.
"Chuck England - MVP" <Cryst...@email.msn.com> wrote in message
news:OZiWfvOC$GA.197@cppssbbsa03...