Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15687 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81844 invoked by uid 1010); 30 Mar 2005 15:22:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 81713 invoked from network); 30 Mar 2005 15:22:51 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 30 Mar 2005 15:22:51 -0000 X-Host-Fingerprint: 62.245.70.224 r2g224.chello.upc.cz FreeBSD 4.6-4.9 Received: from ([62.245.70.224:3286] helo=isis.sigpipe.cz) by pb1.pair.com (ecelerity HEAD r(5268)) with SMTP id B9/4C-22409-714CA424 for ; Wed, 30 Mar 2005 10:21:59 -0500 Received: by isis.sigpipe.cz (Postfix, from userid 1001) id CF1201F87BEE; Wed, 30 Mar 2005 17:21:54 +0200 (CEST) Date: Wed, 30 Mar 2005 17:21:54 +0200 To: Derick Rethans Cc: internals@lists.php.net Message-ID: <20050330152154.GB53884@isis.sigpipe.cz> References: <20050326235844.GA6613@isis.sigpipe.cz> <20050329113532.GA42955@isis.sigpipe.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Subject: Re: [PHP-DEV] snprintf / ap_php_snprintf, %lld, gcc versions? From: neuhauser@sigpipe.cz (Roman Neuhauser) # derick@php.net / 2005-03-30 09:55:57 -0500: > On Tue, 29 Mar 2005, Roman Neuhauser wrote: > > > > > #define snprintf ap_php_snprintf > > > > PHPAPI int ap_php_snprintf(char *buf, size_t len, const char *format,...) > > > > > > For some reason the header file is not included then - that should be > > > fixed as our own (ap_php_snprintf) function should always be used which > > > is not gcc dependent. > > > > Turns out you are right, but probably not the way you expected: > > > > %lld is broken on the boxes where snprintf expands to > > %ap_php_snprintf(). The difference is in the installed > > include/php/main/snprintf.h file (present vs. missing > > HAVE_SNPRINTF check), at least between a pair of hosts I'm looking > > at right now. > > > > So now the question is: what is the best (least intrusive) way to > > make sure the system snprintf is used? #if 0 the snprintf macro? > > Don't do that :) To be honest, at this point I don't trust ap_php_s*printf with my data. If ap_php_snprintf is meant as a drop-in replacement for snprintf, then I don't see what would break if I did exactly that (before recompiling all of PHP + extensions). I wound up putting #undef snprintf in the extencsion's header file, and that fixed it, but to be honest, I'm shitting bricks from fear that other parts of the installation are broken as well, and will break my code in totally unexpected places, and damage the data in new ways. > > BTW, perhaps the unconditional ap_php_snprintf use could be backed > > out until the function is mature enough to actually be an > > improvement? See also > > http://marc.theaimsgroup.com/?l=php-dev&m=110746124520191&w=2 > > No, we should not back it out, but fix our ap_php_snprintf function, but > it seems you already filed a bug about this which is assigned to Marcus. Yup, I did. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991