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 Sat, 21 Mar 1998 18:59:07 GMT
On Sat, 21 Mar 1998, Jim Jagielski wrote:

> Marc Slemko wrote:
> > 
> > I shall die before I cast a pid to unsigned long on a platform where it
> > may not be valid!
> > 
> Please explain, exactly, how getpid() could return a value that would
> be non-valid if cast to unsigned long? This could ONLY happen if
> getpid() returned an integer number greater than unsigned long OR
> returned a signed value. If the former, then there is NO WAY to
> have any printf() function handle it, since they only allow 'lu'

Why not?  My printf handles "qu".  

The point is that if we actually detected the size of it then we would
know if it didn't fit inside a long on that platform and, if so, could be
sure to whine about that fact and figure out the right way on that

Again, this isn't necessarily the end of the world for pid_t since it is
one of the safer ones, but there are other things that do really need this
a lot more, and it works the same for them all.

> and not some mystical "bigger than unsigned long" integer. And the
> latter would be a bogus implementation because it would confuse the
> hell out of functions that assume negative values are process
> groups, etc...
> -- 
> ===========================================================================
>    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