httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: cvs commit: apache-1.3/src/main http_main.c
Date Wed, 18 Mar 1998 01:11:03 GMT
Marc Slemko wrote:
> > 
> > Even so, then getpid() would return an 64bit long but ap_snprintf
> > would be expecting a 32bit unsigned long (because of the .lu).
> But in that case the code is just broken for not dealing with it.  You
> would get the warning (with the right compiler, right options, etc.) when
> the result of getpid() is implicitly cast to pass it to the function.  If
> you cast it, then the code is worse than broken because it hides problems
> as opposed to just not dealing with them.

cast is specifically "designed" to force things to align correctly...
If ap_snprintf() is expecting an unsigned long, then the cast
simply forces that. I don't see how this avoidance of a concern
is worse than just not dealing with it :/

Not only that, but ap_snprintf specfically uses va_arg to pull off
an unsigned long.

   Jim Jagielski   |||   |||
            "That's no ordinary rabbit... that's the most foul,
            cruel and bad-tempered rodent you ever laid eyes on"

View raw message