http://bugzilla.spamassassin.org/show_bug.cgi?id=3452





------- Additional Comments From [EMAIL PROTECTED]  2004-05-31 18:50 -------
Subject: Re:  compiler warnings in VC++ (Windows) spamc build

> I looked at the warning in spamc.c:240 -- the issue the compiler doesn't
like
> is that transport.port is unsigned short while atoi() returns int. What's
the
> correct way to fix this? casting to (unsigned short) explicitly?

That would be the traditional way to do it, since this is C rather than C++.
If the target is defined as unsigned short in the local code, yes, that is
exactly the right way.  If the target is a system-defined function, it is
better to cast to the typedef used for the parameter, if one was used.
Often with Unix-based functions no typedef is used, so (unsigned short) is
the correct answer.


  > To get rid of the libspamc.c:8xx we should probably use size_t instead
of int
> -- is that portable?

Yes.  At least it should be.


> To avoid the conversion stuff, maybe /W3 is enough?

W3 is usually pretty good, but the couple of casts required in this case for
W4 might be worthwhile.  W4 is largely annoying, but it can uncover a few
actual silent errors in code.

        Loren





------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to