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 / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

How to suppress warning in VC++

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J Swift - 03 Mar 2005 23:20 GMT
I posted this question earlier but on the wrong usenet.
I have a warning below that I need to suppress

*warning C4018: '<' : signed/unsigned mismatch

I searched google, Microsoft help and MSDN for an answer but no luck.
I don't want to fix the cause because it's how the program is supposed to
work. It's part of an example in a text and the example suppresses a similar
warning in Borland. I am sure there must be a way to do this in dotnet, but
how?
Carl Daniel [VC++ MVP] - 03 Mar 2005 23:54 GMT
> I posted this question earlier but on the wrong usenet.
> I have a warning below that I need to suppress
[quoted text clipped - 6 lines]
> suppresses a similar warning in Borland. I am sure there must be a
> way to do this in dotnet, but how?

Cast one of the operands to the other type.

e.g.

int i;
unsigned j;
// ...

if (unsigned(i) < j)
{
   // ...
}

-cd
Fredrik Wahlgren - 04 Mar 2005 00:35 GMT
> I posted this question earlier but on the wrong usenet.
> I have a warning below that I need to suppress
[quoted text clipped - 6 lines]
> warning in Borland. I am sure there must be a way to do this in dotnet, but
> how?

pragma warning (disable: 4018)

/Fredrik
John L. DeVito - 04 Mar 2005 01:05 GMT
If you are using VS.NET you can also lower your compilers warning level this
may help.  For example go to Project->Properties under C\C++ change the
warning level to one lower than what it is currently set at and continue to
drop it until the warning goes away, or just turn off warning altogether
(not recommended).  You can also do this is you are using the command line
version of the compiler by issue the /W<warning level number> ie /W3 /W2 /W1
etc or /W0 for no warnings.

Hope that helps.

John
>I posted this question earlier but on the wrong usenet.
> I have a warning below that I need to suppress
[quoted text clipped - 6 lines]
> similar warning in Borland. I am sure there must be a way to do this in
> dotnet, but how?
J Swift - 04 Mar 2005 14:14 GMT
> If you are using VS.NET you can also lower your compilers warning level
> this may help.  For example go to Project->Properties under C\C++ change
[quoted text clipped - 17 lines]
>> similar warning in Borland. I am sure there must be a way to do this in
>> dotnet, but how?

Thanks to all who answered... I got through it and learned more by your
responses

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.