httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <>
Subject Re: cvs commit: httpd-2.0/support/win32 ApacheMonitor.c
Date Thu, 07 Oct 2004 03:08:44 GMT
Allan Edwards wrote:
> Mladen Turk wrote:
>> That's true, but the strlen can never be int (negative).
>> The API is DWORD meaning 32 bit unsigned integer, so either
>> cast to API or no cast.
> You are correct that for WriteConsole the cast should
> have been DWORD - I will fix that, thanks

Look, I'm sorry if you found my initial post offending cause
I've used the 'v' word, but the way you've headed would make
almost any CRT lib call casted, and that just doesn't make
sense to me. Both apr and libhttpd has more then 100 of those
when /Wp64 is used, so IMO we would just hide the problems under
carpet if just casting every 64->32 warning found.
For example inside http_protocol.c you have:
'int len = strlen(method)', that is wrong by all means, but I
wouldn't write that as 'int len = (int)strlen(method)' just to make
the compiler happy, but rather use 'size_t len = strlen(method)'.

 > For TextOut and lstrcpyn the parameter is in fact int
 > so we either have to cast to int and assmume the
 > string length will never by > 2Gig (seems reasonable),
 > or we need to explicitly check for strlen > 2Gig and
 > fail if it is, or use a different API (if there is one).

Well, that one is probably OK. I was talking about the concept
of not casting just for the sake of making compiler happy.


View raw message