httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: New compile warning this AM
Date Thu, 19 Mar 1998 20:18:53 GMT
On Thu, 19 Mar 1998, Jim Jagielski wrote:

> Did you even look at Ken's message? Doesn't look like it. Notice
> the error message. Have you followed Marc's discussion about we
> we shouldn't cast it? He mentions 64bit uids. That's where that comes
> from.
> Now listen closely... the format statement we are using for
> ap_snprintf() is 'lu', which is unsigned long. Depending
> on the OS, getpid() could return anything from shorts to ints
> to longs to whatever. Unless we want to get compiler warnings
> all the time, if ap_snprintf() is expecting an unsigned long,
> we should provide an unsigned long.

Uhuh.  And Dean says we should be telling printf the right type to use
instead of bogusly casting what we do have.  If we had a configuration
system that can know what type getpid() returns, then it is easy
to setup the right printf format strings for it.  This is useful
in general, not just for this.


#define BAR "%lu"
#define BAR "%ld"
#elif FOO_TYPE == INT
#define BAR "%d"


View raw message