Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / June 2005

Tip: Looking for answers? Try searching our database.

possible bug with visual C++ .net 2003 and warnings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Wilson - 27 Jun 2005 00:52 GMT
In my code, I have this
#include <queue>
#include <vector>
I have "warning level 4" and "warnings as errors" turned on.

If I compile my code, it gives me warning C4702 about "unreachable code"
inside the "vector" standard header and warning C4701 about "local variable
x may be used without having been initialized" inside the "xstring"
standard header.

It also gives me C4701 about some things in my code.

I want to disable the warnings in the standard header but not in my code so
I do this:
#pragma warning (disable:4702 4701)
#include <queue>
#include <vector>
#pragma warning (default:4702 4701)
However, now (for some reason), the warnings in my code (which I do want to
trigger) are not triggering

So, firstly, there is a possible bug in the standard header files in that
they cant compile at "warning level 4" and "warnings as errors" and
secondly there is a possible bug in that the #pragma warning (default:4702
4701) statement isnt re-enabling the checks for warning C4702 properly.

If anyone knows more about these bugs (or better yet, how to get things to
do what I want so the warnings in my code trigger and those in the header
files do not), please do let me know.
Jakob Bieling - 27 Jun 2005 06:09 GMT
> I want to disable the warnings in the standard header but not in my
> code so I do this:
[quoted text clipped - 4 lines]
> However, now (for some reason), the warnings in my code (which I do
> want to trigger) are not triggering

   You could try if pushing and popping the warning state works for
you:

#pragma warning (push)
#pragma warning (disable : 4702 4701)
#include <queue>
#include <vector>
#pragma warning (pop)

hth
Signature

jb

(reply address in rot13, unscramble first)

Jonathan Wilson - 27 Jun 2005 10:15 GMT
> #pragma warning (push)
> #pragma warning (disable : 4702 4701)
> #include <queue>
> #include <vector>
> #pragma warning (pop)
I tried that and it didnt work either :(

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.