httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_include.c
Date Mon, 12 Jun 2000 18:36:42 GMT
On Sun, Jun 11, 2000 at 10:50:58AM -0400, Jeff Trawick wrote:
> > From: ben@locus.apache.org
> > Date: 11 Jun 2000 14:04:53 -0000
> > 
> > ben         00/06/11 07:04:53
> > 
> >   Modified:    src/modules/standard mod_include.c
> >   Log:
> >   Do printf formatting properly.
> >   
> >                        int l, x;
> >   -#if defined(AP_OFF_T_IS_QUAD)
> >   -                    ap_snprintf(tag, sizeof(tag), "%qd", finfo.size);
> >   -#else
> >   -                    ap_snprintf(tag, sizeof(tag), "%ld", (long)finfo.size);
> >   -#endif
> >   +                    ap_snprintf(tag, sizeof(tag), "%" APR_OFF_T_FMT, finfo.size);
> >                        l = strlen(tag);    /* grrr */
> 
> As of this commit we now have warnings on Linux.  Did you see the
> discussion (or rather, me explaining why I couldn't proceed with
> Ryan's sugession) yesterday?
> 
> What's the plan on getting APR_OFF_T_FMT defined properly?  
> 
> I don't know how to work around the problem I described to Ryan
> yesterday.  How can we safely check during autoconfiguration whether
> off_t is long int or just int when the size is the same?  Unless this
> is resolved, I don't see the value in AP_OFF_T_FMT unless there is
> also an AP_OFF_T_CAST which is used to avoid warnings.  That
> combination isn't pretty, but at least it avoids the old need to check
> AP_OFF_T_IS_QUAD.

We can enable "warnings are errors" in GCC, then try to compile a test
fragment. If the "%d" and off_t sizes are wrong, then we get an error.

Of course, this will be specific to GCC, so there would need to be
mechanisms for other compilers (most compilers have a similar flag), or we
would need to use the hints.m4 file to patch up the resulting value.

How's that sound?

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message