Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > C4701 warning - unable to disable this warning using pragmas
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 15th September 00:43
dennis
External User
 
Posts: 1
Default C4701 warning - unable to disable this warning using pragmas



I am unable to suppress this warning: (caused be doing #include
<string>)
<string> includes <xstring> which generates the warning.

c:\program files\microsoft visual studio .net
2003\vc7\include\xstring(1466) : warning C4701: local variable '_Ptr'
may be used without having been initialized


I don't want to change to warning level 3.

I have tried creating a file called string_.h which I include which
does the following:

-------------- string_.h: ------------
#pragma warning ( push, 3 )
#include <string>
#pragma warning ( pop )


I have also tried:
#pragma warning ( disable : 4701 )
#include <string>
#pragma warning ( default : 4701 )

and other combinations and nothing works, any ideas? !!!

precompiled headers are being used, I tried turning those off and there
seems to be no effect on the pragmas working. This is a .cpp file
under
..NET 2003 vc7 compiler.


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote


 


2 20th September 22:21
alberto barbati
External User
 
Posts: 1
Default C4701 warning - unable to disable this warning using pragmas



This question isn't about C++, but a compiler-specific (non-programming)
issue. The right newsgroup for it is microsoft.public.vc.stl, not here.

{Possibly, but the line you quote is not evidence of your claim.
Specifying the compiler being used can help others give guidance even if
the code is not compiler specific. -mod}

Alberto

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote
3 20th September 22:23
joe
External User
 
Posts: 1
Default C4701 warning - unable to disable this warning using pragmas


Rather than looking at how to disable the warning, you should
concentrate on fixing your code. I use strings all the time without
warnings, so it's likely that you really have a problem.

joe


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
  Reply With Quote
Reply


Thread Tools
Display Modes




666