httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_include.c
Date Sat, 10 Jun 2000 19:33:01 GMT
> From: rbb@covalent.net
> Date: Sat, 10 Jun 2000 12:07:45 -0700 (PDT)
> 
> >   @@ -1196,7 +1196,7 @@
> >    #if defined(AP_OFF_T_IS_QUAD)
> >                        ap_snprintf(tag, sizeof(tag), "%qd", finfo.size);
> >    #else
> >   -                    ap_snprintf(tag, sizeof(tag), "%ld", finfo.size);
> >   +                    ap_snprintf(tag, sizeof(tag), "%ld", (long)finfo.size);
> >    #endif
> >                        l = strlen(tag);    /* grrr */
> >                        for (x = 0; x < l; x++) {
> 
> I dislike this.  Apache in general doesn't use casts, because they mask
> real problems.  APR provides an easy MACRO APR_OFF_T_FMT that will fix
> this problem correctly without requiring a cast.  I think we should be
> using it.

Actually, APR_OFF_T_FMT is broken; gcc distinguishes between int and
long int when checking such parms, but the configuration check for
APR_OFF_T_FMT doesn't distinguish between int and long int because the
sizes are the same.

I'll leave it as-is for now.  It is safe shouldn't generate warnings
either.


-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Mime
View raw message