httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: New compile warning this AM
Date Thu, 19 Mar 1998 20:03:26 GMT
#define PRINTF_A_PID_T  "%lu"

ap_snprintf("blah blah blah" PRINTF_A_PID_T "blah blah", getpid());

A long isn't 64-bits, I don't know what you're referring to.

Casts hide bugs.

Dean

On Thu, 19 Mar 1998, Jim Jagielski wrote:

> Marc Slemko wrote:
> > 
> > On Thu, 19 Mar 1998, Jim Jagielski wrote:
> > 
> > > Rodent of Unusual Size wrote:
> > > > 
> > > > No time to look at this.. on x86/Linux:
> > > > 
> > > > gcc -c  -I../os/unix -I../include  -O0 -g -DLINUX=2 -DSTATUS
> > > >  -DUSE_HSREGEX -DHIDE -Wall  http_main.c
> > > > http_main.c: In function `expand_lock_fname':
> > > > http_main.c:342: warning: long unsigned int format,
> > > >  unsigned int arg (arg 4)
> > > > 
> > > > #ken	P-)}
> > > > 
> > > 
> > > It would be fixed by that cast that Marc doesn't want to do...
> > > 
> > 
> > No, it would be hidden.
> > 
> > It would be fixed by the autoconf you don't want to do.
> > 
> 
> How would autoconf rewrite the format-argument to ap_snprintf()?
> 
> The format used is 'lu' which says unsigned-long. We should cast
> getpid() to that. Unless, of course, you wish to create a new data-type
> which is 64bits and have ap_snprintf() have a new format statement
> that handles that and then cast getpid() to that format.
> -- 
> ===========================================================================
>    Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
>             "That's no ordinary rabbit... that's the most foul,
>             cruel and bad-tempered rodent you ever laid eyes on"
> 


Mime
View raw message