Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 83306 invoked from network); 11 Aug 2010 18:39:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 18:39:25 -0000 Received: (qmail 57495 invoked by uid 500); 11 Aug 2010 18:39:25 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 57366 invoked by uid 500); 11 Aug 2010 18:39:24 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 57359 invoked by uid 99); 11 Aug 2010 18:39:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 18:39:24 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 76.96.62.24 is neither permitted nor denied by domain of jim@jagunet.com) Received: from [76.96.62.24] (HELO qmta02.westchester.pa.mail.comcast.net) (76.96.62.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 18:39:15 +0000 Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) by qmta02.westchester.pa.mail.comcast.net with comcast id sz4r1e0021GhbT8526ewWG; Wed, 11 Aug 2010 18:38:56 +0000 Received: from [192.168.199.10] ([69.251.84.64]) by omta07.westchester.pa.mail.comcast.net with comcast id t6eu1e0021PGofZ3T6evJg; Wed, 11 Aug 2010 18:38:55 +0000 Subject: Re: %lld/%llu not handled by apr_vformatter Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Jim Jagielski In-Reply-To: Date: Wed, 11 Aug 2010 14:38:53 -0400 Cc: Chris Knight , APR Developer List Content-Transfer-Encoding: quoted-printable Message-Id: <41C02C08-93A3-45A1-B19B-79173BBB286A@jaguNET.com> References: To: Hyrum K. Wright X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org Universal binaries for OS X and APR are not supported. I must force either 32 or 64 bit... Attempts to fix this at the APR level have been vetoed and so no further effort can be done. The long and short of it (no pun intended) is that under OS X and universal binaries, you can no longer have some type lengths statically defined in *.h files as being a certain number of bits. Instead, the APR *.h files would require some internal #if tests which "looks" to see how the package is being compiled and then selects the correct set of bit sizes... This was deemed "too ugly" and was vetoed. For hints, I would encourage people to see how MacPorts works around this... On Aug 11, 2010, at 12:02 PM, Hyrum K. Wright wrote: > Unfortunately, you seem to have found the same bug I uncovered in = March: > = http://mail-archives.apache.org/mod_mbox/apr-dev/201003.mbox/%3Cb51ffb6f10= 03100926n22c1dd79id9696972b23a153a@mail.gmail.com%3E >=20 > To my knowledge it hasn't been fixed, thought that thread does include > a somewhat hacky patch to work around the issue. Perhaps it will be > of use to you. >=20 > -Hyrum >=20 > On Wed, Aug 11, 2010 at 10:51 AM, Chris Knight > wrote: >> I spent half-a-day yesterday trying to figure out why I was crashing = in apr_psprintf on a strlen until I realized that my "%llu%s" format = string was causing it to use my long long int as a char *. >>=20 >> Needless to say, no harm in adding support for %ll[du] yes? >>=20 >> Ah, 64-bit fun for everyone.... >>=20 >> Example code: >>=20 >> #include >> #include >> #include >> #include >>=20 >> int main(int argc, char **argv) { >> apr_pool_t *pool =3D NULL; >> char *s =3D "hello world"; u_int64_t v =3D 12345678; >>=20 >> apr_pool_initialize(); apr_pool_create(&(pool), NULL); >> printf("%llu%s", v, s); // works >> char *f =3D apr_psprintf(pool, "%llu%s", v, s); // segfault on = strlen >> printf("%s\n", f); >> } >=20