You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ben Laurie <be...@gonzo.ben.algroup.co.uk> on 1996/10/31 08:16:17 UTC
Re: cvs commit: apache/src http_protocol.c
Brian Behlendorf wrote:
>
> brian 96/10/30 18:08:52
>
> Modified: src http_protocol.c
> Log:
> yet another -Wall warning squished.
>
> Revision Changes Path
> 1.67 +1 -1 apache/src/http_protocol.c
>
> Index: http_protocol.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_protocol.c,v
> retrieving revision 1.66
> retrieving revision 1.67
> diff -C3 -r1.66 -r1.67
> *** http_protocol.c 1996/10/28 16:05:45 1.66
> --- http_protocol.c 1996/10/31 02:08:50 1.67
> ***************
> *** 342,348 ****
> */
>
> 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);
> --- 342,348 ----
> */
>
> 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!
Cheers,
Ben.
--
Ben Laurie Phone: +44 (181) 994 6435 Email: ben@algroup.co.uk
Freelance Consultant and Fax: +44 (181) 994 6472
Technical Director URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd, Apache Group member (http://www.apache.org)
London, England. Apache-SSL author
Re: cvs commit: apache/src http_protocol.c
Posted by Brian Behlendorf <br...@organic.com>.
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