php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50771 ZEND_GCC_VERSION is incorrectly defined
Submitted: 2010-01-15 17:53 UTC Modified: 2010-01-15 18:27 UTC
From: alex dot belonosov at gmail dot com Assigned:
Status: Closed Package: *Compile Issues
PHP Version: 5.3.1 OS: Linux GCC3.4
Private report: No CVE-ID: None
 [2010-01-15 17:53 UTC] alex dot belonosov at gmail dot com
Description:
------------
The definition of ZEND_GCC_VERSION is incorrect in zend.h or further checks for version 3400 is incorrect.

It's defined as ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
But __GNUC_MINOR__ is usually one digit e.g. __GNUC_MINOR__ is 4 for GCC3.4. This causes problems with php extensions compatibility built with GCC3.4 with another PHP built with GCC4+ The reason is difference in ZEND_FASTCALL definitions under different GCCs. 

I suppose you guys meant 3004 instead of 3400 in ZEND_GCC_VERSION conditions within zend.h as I think nobody can expect GCC with the minor version number=400 to make the condition for ZEND_FASTCALL true for GCC3. See zend.h:169 and below

Or ZEND_GCC_VERSION definition should be changed to ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__ * 100) but you will also need to correct other ZEND_GCC_VERSION conditions.

Please correct the above in any way as the current code is inconsistent with all GCC3 since v3.4

Thanks


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-15 18:26 UTC] svn@php.net
Automatic comment from SVN on behalf of rasmus
Revision: http://svn.php.net/viewvc/?view=revision&revision=293590
Log: Fix gcc version check - bug #50771
 [2010-01-15 18:27 UTC] rasmus@php.net
I don't think we want to change the ZEND_GCC_VERSION macro.  We do 
actually want 3004 for GCC 3.4 and not 3400.  The bug is the check for 
3400 there.  If we switched to 3400 then how do we handle the check for 
GCC 2.96?  That wouldn't work.  Right now we check for 2096.  I have 
changed the 3400 to 3004 in zend.h.
 [2010-02-03 20:44 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294459
Log: - Fix gcc version check - bug #50771
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC