Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82907 invoked from network); 23 Jul 2009 12:22:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jul 2009 12:22:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 213.123.26.179 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 213.123.26.179 c2beaomr01.btconnect.com Received: from [213.123.26.179] ([213.123.26.179:11609] helo=c2beaomr01.btconnect.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/11-11537-8F5586A4 for ; Thu, 23 Jul 2009 08:22:16 -0400 Received: from [10.0.0.141] (host81-138-11-136.in-addr.btopenworld.com [81.138.11.136]) by c2beaomr01.btconnect.com with ESMTP id DXA31019; Thu, 23 Jul 2009 13:22:09 +0100 (BST) Message-ID: <4A6855ED.8@lsces.co.uk> Date: Thu, 23 Jul 2009 13:22:05 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.21) Gecko/20090303 SeaMonkey/1.1.15 (Ubuntu-1.1.15+nobinonly-0ubuntu2) MIME-Version: 1.0 To: php internals Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Status: score=10/50, host=c2beaomr01.btconnect.com X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A0B0207.4A6855F5.028E,ss=1,fgs=0, ip=10.0.0.141, so=2009-06-02 17:34:35, dmn=5.7.1/2009-06-05, mode=single engine X-Junkmail-IWF: false Subject: sprintf or spprintf From: lester@lsces.co.uk (Lester Caine) We are still battling problems with 64 bit builds and it seems that how spprintf is handled is the key to the problem. On my own builds on Linux64 and Windows64, the following works ... char *_php_ibase_quad_to_string(ISC_QUAD const qd) /* {{{ */ { char *result; /* shortcut for most common case */ if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) { spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16, *(ISC_UINT64*)(void *) &qd); } else { ISC_UINT64 res = ((ISC_UINT64) qd.gds_quad_high << 0x20) | qd.gds_quad_low; spprintf(&result, BLOB_ID_LEN+1, "0x%0*" LL_MASK "x", 16, res); } return result; } but people are reporting that they have to switch back to the previous sprintf based version to get it to work ... char *_php_ibase_quad_to_string(ISC_QUAD const qd) /* {{{ */ { char *result = (char *) emalloc(BLOB_ID_LEN+1); /* shortcut for most common case */ if (sizeof(ISC_QUAD) == sizeof(ISC_UINT64)) { sprintf(result, "0x%0*" LL_MASK "x", 16, *(ISC_UINT64*)(void *) &qd); } else { ISC_UINT64 res = ((ISC_UINT64) qd.gds_quad_high << 0x20) | qd.gds_quad_low; sprintf(result, "0x%0*" LL_MASK "x", 16, res); } result[BLOB_ID_LEN] = '\0'; return result; } It would seem that while the 'memory allocation standard' was changed around 5.2.0, at which time php_interbase developed the problem, there was nothing actually done to the code around 5.2.6 which fixed it? Only how it was compiled seems to have changed .... although I'm not certain that I am actually looking in the right place following the move to SVN -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php