Last modified: 2012-01-19 22:07:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T26357, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 24357 - wikidiff2: make error with PHP 5.2.x
wikidiff2: make error with PHP 5.2.x
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
wikidiff2 (Other open bugs)
unspecified
All Linux
: Normal major (vote)
: ---
Assigned To: Tim Starling
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-13 05:01 UTC by Kkkdc @jawiki
Modified: 2012-01-19 22:07 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch for php_wikidiff2.cpp (r67994) (824 bytes, patch)
2010-07-13 05:01 UTC, Kkkdc @jawiki
Details

Description Kkkdc @jawiki 2010-07-13 05:01:12 UTC
Created attachment 7567 [details]
patch for php_wikidiff2.cpp (r67994)

When using GCC 4.4, `make` shows following errors: 
    php_wikidiff2.cpp:36: error: invalid conversion from ‘const zend_function_entry*’ to ‘_zend_function_entry*’
    php_wikidiff2.cpp:94: error: invalid conversion from ‘const char*’ to ‘char*’

see http://blog.flameeyes.eu/2009/07/02/how-not-to-fix-gcc-4-4-bugs
We must use the const_cast.
Comment 1 Tim Starling 2010-07-13 07:14:41 UTC
I am using GCC 4.4 and I don't see any such error. What version of PHP? Did you customise CXXFLAGS or CFLAGS?
Comment 2 Kkkdc @jawiki 2010-07-13 07:30:14 UTC
$ php --version
PHP 5.2.13 (cli) (built: Mar  6 2010 12:40:51)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator


$ phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519


$ gcc --version
gcc (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2)


I don't customize CXXFLAGS and CFLAGS, thanks.

(in Makefile)
CFLAGS = -g -O2
CXXFLAGS = -g -O2
Comment 3 Antoine "hashar" Musso (WMF) 2010-09-30 21:25:53 UTC
Tim : maybe you have a different Zend API version which returns a const.

You made the ret variable a constant :  
  const Wikidiff2::String & ret = wikidiff2.execute(text1String, text2String, numContextLines);

But my Zend_API.h specify a char* (the variable is 's' below):

#define ZVAL_STRINGL(z, s, l, duplicate) {  \
        char *__s=(s); int __l=l;       \
        (z)->value.str.len = __l;       \
        (z)->value.str.val = (duplicate?estrndup(__s, __l):__s);    \
        (z)->type = IS_STRING;          \
    }


My zend_API.h :
/* $Id: zend_API.h,v 1.207.2.8.2.9 2007/12/31 07:20:02 sebastian Exp $ */

$ phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519

$ php -version
PHP 5.2.12 (cli) (built: Feb  9 2010 00:34:23) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

$ gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
Comment 4 Sumana Harihareswara 2012-01-14 21:37:18 UTC
Thanks for the patch, Kkkdc @jawiki.  Can you still reproduce the problem?
Comment 5 Tim Starling 2012-01-19 21:57:24 UTC
(In reply to comment #4)
> Thanks for the patch, Kkkdc @jawiki.  Can you still reproduce the problem?

Of course it's still reproducible, I haven't changed anything.

The relevant declarations did change from PHP 5.2 to PHP 5.3. Both ZVAL_STRINGL() and _zend_module_entry were changed to accept a const. Updating summary appropriately. I will apply the patch.
Comment 6 Tim Starling 2012-01-19 22:07:40 UTC
Committed in r109574.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links