Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 51563 invoked from network); 17 Jan 2011 21:25:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jan 2011 21:25:30 -0000 Received: (qmail 43580 invoked by uid 500); 17 Jan 2011 21:25:30 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 43505 invoked by uid 500); 17 Jan 2011 21:25:29 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 43497 invoked by uid 99); 17 Jan 2011 21:25:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 21:25:29 +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: local policy) Received: from [76.96.59.243] (HELO qmta13.westchester.pa.mail.comcast.net) (76.96.59.243) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jan 2011 21:25:19 +0000 Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71]) by qmta13.westchester.pa.mail.comcast.net with comcast id wkm81f0091YDfWL5DlQyNC; Mon, 17 Jan 2011 21:24:58 +0000 Received: from [192.168.199.10] ([69.251.84.64]) by omta20.westchester.pa.mail.comcast.net with comcast id wlQx1f0121PGofZ3glQxwY; Mon, 17 Jan 2011 21:24:58 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1082) Subject: Re: Weird weirdness with %lld and apr_psprintf From: Jim Jagielski In-Reply-To: Date: Mon, 17 Jan 2011 16:24:56 -0500 Content-Transfer-Encoding: 7bit Message-Id: References: To: APR Developer List , dev@httpd.apache.org X-Mailer: Apple Mail (2.1082) X-Virus-Checked: Checked by ClamAV on apache.org I think it is related to OS X and vformatter: if ((sizeof(APR_INT64_T_FMT) == 4 && fmt[0] == APR_INT64_T_FMT[0] && fmt[1] == APR_INT64_T_FMT[1]) || (sizeof(APR_INT64_T_FMT) == 3 && fmt[0] == APR_INT64_T_FMT[0]) || (sizeof(APR_INT64_T_FMT) > 4 && strncmp(fmt, APR_INT64_T_FMT, sizeof(APR_INT64_T_FMT) - 2) == 0)) { /* Need to account for trailing 'd' and null in sizeof() */ var_type = IS_QUAD; fmt += (sizeof(APR_INT64_T_FMT) - 2); } else if (*fmt == 'q') { var_type = IS_QUAD; fmt++; } else if (*fmt == 'l') { var_type = IS_LONG; fmt++; } under OS X, 64bit, APR_INT64_T_FMT is 'ld' and APR_OFF_T_FMT is 'lld'... In fact, I'm sure it is... Looking over the archives, I see a few patches floating around for this... On Jan 17, 2011, at 3:58 PM, Jim Jagielski wrote: > OK, I was getting some weird weird errors with the byterange tests > for httpd... it was always failing. Looking over the output, what > I was seeing is that the output was sending out, well... see the below: > > # Failed test 149 in t/apache/byterange.t at line 52 fail #149 > Range: bytes=0-8192 > Content-Range: bytes %ld-%ld/%ld > > This is when APR_OFF_T_FMT is "lld" > > No look at this... I change the section of code in byterange_filter.c > to: > if (ctx->num_ranges == 1) { > apr_table_setn(r->headers_out, "Content-Range", > apr_psprintf(r->pool, "bytes %lld - %lld / %lld", > range_start, range_end, clength)); > > and I get *this*! > > # Failed test 149 in t/apache/byterange.t at line 52 fail #149 > Range: bytes=0-8192 > Content-Range: bytes %ld - %ld / %ld > > Note that it looks like something is compressing %lld to %ld! >