httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Murcko <ch...@n2k.com>
Subject Re: cvs commit: apache/src http_protocol.c
Date Thu, 31 Oct 1996 21:42:34 GMT
Not sure if the first try made it; here's another:

Is there any reason that

    if (r->finfo.st_mode != 0)
        sprintf(weak_etag, "W/\"%lx-%lx-%lx\"", (unsigned long)r->finfo.st_ino,
		(unsigned long)r->finfo.st_size, mtime);

isn't portable? It fixes the warning everywhere here (FreeBSD, BSDI, Solaris,
Irix).

Brian Behlendorf liltingly intones:
> 
> On Thu, 31 Oct 1996, Ben Laurie wrote:
> > >         if (r->finfo.st_mode != 0)
> > >   !         sprintf(weak_etag, "W/\"%lx-%Lx-%lx\"", r->finfo.st_ino,
> > >     		r->finfo.st_size, mtime);
> > >         else
> > >             sprintf(weak_etag, "W/\"%lx\"", mtime);
> > 
> > Whoah! That one's not portable. From SCO 5 man sprintf:
> > 
> >           L       For a, A, e, E, f, F, g, and G, the argument has type long
> >                   double.
> > 
> > L isn't even permitted for x!
> 
> It's weird to me, too; st_size is a long, yet this patch squelched the error I
> was seeing on BSDI:
> 
>   http_protocol.c: In function `set_last_modified':
>   http_protocol.c:346: warning: long unsigned int format, different type arg (arg 4)
> 
> Is GCC on bsdi just plain wrong on this?  
> 
> I now see that this patch *introduces* the same error message on solaris and
> irix it squelches on bsdi.  I only have access to those three platforms; if
> someone else knows how to fix this across platforms and compilers then please
> let us know.  In the meantime I'll reverse the patch.
> 
> 	Brian
> 
> --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
> brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS
> 
> 

chuck
Chuck Murcko	N2K Inc.	Wayne PA	chuck@telebase.com
And now, on a lighter note:
"I had to censor everything my sons watched ... even on the Mary Tyler
Moore show I heard the word 'damn'!"
		-- Mary Lou Bax

Mime
View raw message