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