php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25211 'with-zlib' or 'with-bz2' causes redeclaration of php_image_type_to_mime_type
Submitted: 2003-08-22 10:15 UTC Modified: 2005-09-02 08:46 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: php at hottub dot ca Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4CVS OS: AIX 5.1 ML4
Private report: No CVE-ID: None
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
32 - 18 = ?
Subscribe to this entry?

 
 [2003-08-22 10:15 UTC] php at hottub dot ca
Description:
------------
Trying to compile 4.3.3RC4 on AIX 5.1 ML4 using IBM 
Visual Age C version 6.0 (cc).

PHP compiles properly with other options without issue, 
but when issuing configure with the --with-zlib and --
with-bz2 options, compilation fails.  Here is the 
command being executed:

cc  -Iext/standard/ -I/build/php-4.3.3RC4/ext/standard/ 
-DPHP_ATOM_INC -I/build/php-4.3.3RC4/include -I/build/
php-4.3.3RC4/main -I/build/php-4.3.3RC4 -I/build/php-
4.3.3RC4/Zend -I/usr/local/include -I/build/php-
4.3.3RC4/ext/xml/expat  -I/build/php-4.3.3RC4/TSRM  -g  
-c /build/php-4.3.3RC4/ext/standard/image.c -o ext/
standard/image.o  && echo > ext/standard/image.lo

And the error output:

"/build/php-4.3.3RC4/ext/standard/image.c", line 
1029.21: 1506-343 (S) Redeclaration of 
php_image_type_to_mime_type differs from previous 
declaration on line 60 of "/build/php-4.3.3RC4/ext/
standard/php_image.h".
"/build/php-4.3.3RC4/ext/standard/image.c", line 
1029.21: 1506-050 (I) Return type "unsigned char*" in 
redeclaration is not compatible with the previous 
return type "const unsigned char*".
make: *** [ext/standard/image.lo] Error 1

The system does not have mysql installed (IBM's DB2 is 
installed, but not enabled as a configuration option).  
There are also a number of warnings during compilation 
that all relate to mysql.h:

"/build/php-4.3.3RC4/ext/mysql/libmysql/mysql.h", line 
181.14: 1506-731 (W) The '_Export' keyword is not 
supported on the target platform.  The keyword is 
ignored.

This is the output from configure when the options are 
enabled:

00Configuring extensions00
checking for ZLIB support... yes
checking if the location of ZLIB install directory is 
defined... no
checking for gzgets in -lz... yes
checking whether to enable bc style precision math 
functions... no
checking for BZip2 support... yes
checking for BZip2 in default path... found in /usr
checking for BZ2_bzerror in -lbz2... yes

I can make a shell account available for the assignee 
to test themselves.

-JD.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-22 13:51 UTC] helly@php.net
The declarations are exactly the same but maybe the compiler you use doesn't understand const in return types. So please remove const from the return type in both .c and .h file and tell me if that helps. If it doesn't we need to find out why your compiler thinks the return type is 'unsigned char'.
 [2003-08-22 22:46 UTC] php at hottub dot ca
Removing 'const' from line 60 of ext/standard/
php_image.c allowed a clean compile -- make test will 
be submitted to list after additional configure flags 
have been added.
 [2003-08-23 09:54 UTC] php at hottub dot ca
When I added the remainder of the configure options, 
the error occured again, despite the fact that the 
definitions are the same in both places.  Apparently 
the AIX compiler throws 'unsigned' in front of 'char' 
in header files.

When I edited both php_image.h and image.c to match 
each other (simply 'char'), I got a successful compile.  
Tests have been submitted to the QA site.

On a previous compile attempt, setting both definitions 
to 'const char' resulted in the same error again.  I 
will attempt to determine if this is a compiler issue 
for which there is a fix.
 [2003-08-25 12:56 UTC] php at hottub dot ca
Recompiled with the release version, and this issue has 
not been corrected.
 [2003-08-25 19:03 UTC] sniper@php.net
Does it work if you use GCC?

 [2003-08-25 20:44 UTC] php at hottub dot ca
Haven't used GCC - previous versions were wildly 
unstable on AIX, and only rarely produced usable 
binaries.  If someone can give me clear indication that 
this has changed, I'd consider using it again.
 [2003-09-08 21:00 UTC] php at hottub dot ca
Error persists:

"/build/php4-STABLE-200309082330/ext/standard/image.c", 
line 1029.21: 1506-343 (S) Redeclaration of 
php_image_type_to_mime_type differs from previous 
declaration on line 60 of "/build/php4-STABLE-
200309082330/ext/standard/php_image.h".
"/build/php4-STABLE-200309082330/ext/standard/image.c", 
line 1029.21: 1506-050 (I) Return type "unsigned char*" 
in redeclaration is not compatible with the previous 
return type "const unsigned char*".
make: *** [ext/standard/image.lo] Error 1
 [2003-09-09 11:30 UTC] sniper@php.net
What is the full configure line you used?

 [2003-09-09 15:27 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 [2003-09-09 17:36 UTC] php at hottub dot ca
./configure --with zlib --with-bz2
 [2003-10-02 15:09 UTC] php at hottub dot ca
This bug still appears in a CVS snapshot taken on 
October 1st.
 [2003-10-02 17:12 UTC] sniper@php.net
I'm pretty sure this is bullshit, I tested it myself on AIX..
Please show the error you get.

 [2003-10-02 18:08 UTC] php at hottub dot ca
My comment was truncated.  Please find the log of the 
CVS, buildconf, configure, make, and compile error at:

http://hottub.ca/bullshit.log

-JD.
 [2005-09-02 08:46 UTC] sniper@php.net
It is bullshit, you're using wrong tools to build PHP.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Oct 09 08:01:27 2024 UTC