Article ID: 195386
Article Last Modified on 6/2/2005
#pragma warning (disable : 4786)after including STL headers, disables the warning: 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: Use the pragma directive before you include any STL headers to disable the warnings.
// compile options required: /Zi /GX
#include <iostream>
#include <string>
#include <map>
// move this pragma before the includes above to disable the
//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;
}
122539 BUG: C4786 or C1067 caused by long identifier and /Zi
167355 FIX: C4786 warning is not disabled with #pragma warning
Additional query words: kbDSupport
Keywords: kberrmsg kbtshoot kbstl kbprb kbcompiler KB195386