php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50508 Conflicting HEADER type declarations
Submitted: 2009-12-17 17:06 UTC Modified: 2009-12-18 11:02 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Bjorn dot Wiberg at its dot uu dot se Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.*, 6 OS: IBM AIX 5.3 5300-08-01-0819
Private report: No CVE-ID: None
 [2009-12-17 17:06 UTC] Bjorn dot Wiberg at its dot uu dot se
Description:
------------
Compilation fails due to both and HAVE_ARPA_NAMESER_COMPAT_H and HAVE_ARPA_NAMESER_H being defined in main/php_config.h, with ext/standard/dns.c pulling in both <arpa/nameser_compat.h> and <arpa/nameser.h>, both declaring the HEADER type.

Reproduce code:
---------------
bwiberg@melody-lp04:~/rpm/BUILD/php-5.2.12$ cat config.nice 
#! /bin/sh
#
# Created by configure

CC='gcc' \
'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-cli' \
'--enable-dba' \
'--enable-dbase' \
'--enable-debug' \
'--enable-exif' \
'--enable-embedded-mysqli' \
'--enable-flatfile' \
'--enable-ftp' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-inifile' \
'--enable-mbstring' \
'--enable-shmop' \
'--enable-soap' \
'--enable-sockets' \
'--enable-sqlite-utf8' \
'--enable-sysvmsg' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-zip' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-bz2' \
'--with-cdb' \
'--with-curl' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir=/usr/local' \
'--with-mime-magic' \
'--with-mysql=/usr/local/mysql' \
'--with-openssl=/opt/freeware' \
'--with-png-dir' \
'--with-ttf' \
'--with-xmlrpc' \
'--with-xpm-dir' \
'--with-xsl' \
'--with-zlib' \
'--with-zlib-dir' \
"$@"
bwiberg@melody-lp04:~/rpm/BUILD/php-5.2.12$ 


Expected result:
----------------
No compilation failures.

Actual result:
--------------
 gcc -Iext/standard/ -I/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/ -DPHP_ATOM_INC -I/home/bwiberg/rpm/BUILD/php-5.2.12/include -I/home/bwiberg/rpm/BUILD/php-5.2.12/main -I/home/bwiberg/rpm/BUILD/php-5.2.12 -I/home/bwiberg/rpm/BUILD/php-5.2.12/ext/date/lib -I/usr/local/include/libxml2 -I/opt/freeware/include -I/usr/local/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/home/bwiberg/rpm/BUILD/php-5.2.12/ext/mbstring/oniguruma -I/home/bwiberg/rpm/BUILD/php-5.2.12/ext/mbstring/libmbfl -I/home/bwiberg/rpm/BUILD/php-5.2.12/ext/mbstring/libmbfl/mbfl -I/usr/local/mysql/include -I/home/bwiberg/rpm/BUILD/php-5.2.12/TSRM -I/home/bwiberg/rpm/BUILD/php-5.2.12/Zend -I/usr/include -g -g -O0 -Wall -c /home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c  -DPIC -o ext/standard/.libs/dns.o
In file included from /usr/include/arpa/nameser.h:645,
                 from /home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:62:
/usr/include/arpa/onameser_compat.h:265: error: conflicting types for 'HEADER'
/usr/include/arpa/nameser_compat.h:244: error: previous declaration of 'HEADER' was here
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c: In function 'php_parserr':
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:471: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:475: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:493: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:522: warning: pointer targets in assignment differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:531: warning: pointer targets in passing argument 1 of 'php_sprintf' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:560: warning: pointer targets in assignment differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:575: warning: pointer targets in passing argument 1 of 'php_sprintf' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:599: warning: pointer targets in passing argument 1 of 'php_sprintf' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:651: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:654: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.2.12/ext/standard/dns.c:657: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
make: *** [ext/standard/dns.lo] Error 1
Bad exit status from /var/opt/freeware/tmp/rpm-tmp.6825 (%build)
bwiberg@melody-lp04:~/rpm/SPECS$ 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-17 17:20 UTC] Bjorn dot Wiberg at its dot uu dot se
This also happens with PHP 5.3.1:

/../
 gcc -Iext/standard/ -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/ -DPHP_ATOM_INC -I/home/bwiberg/rpm/BUILD/php-5.3.1/include -I/home/bwiberg/rpm/BUILD/php-5.3.1/main -I/home/bwiberg/rpm/BUILD/php-5.3.1 -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/date/lib -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/ereg/regex -I/usr/local/include/libxml2 -I/opt/freeware/include -I/usr/local/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/mbstring/oniguruma -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/mbstring/libmbfl -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/mbstring/libmbfl/mbfl -I/home/bwiberg/rpm/BUILD/php-5.3.1/ext/sqlite3/libsqlite -I/home/bwiberg/rpm/BUILD/php-5.3.1/TSRM -I/home/bwiberg/rpm/BUILD/php-5.3.1/Zend -I/usr/include -g -fvisibility=hidden -g -O0 -Wall -c /home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/dns.c  -DPIC -o ext/standard/.libs/dns.o
In file included from /home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/dns.c:50:
/usr/include/arpa/nameser_compat.h:244: error: conflicting types for 'HEADER'
/usr/include/arpa/onameser_compat.h:265: error: previous declaration of 'HEADER' was here
/home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/dns.c: In function 'php_parserr':
/home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/dns.c:501: warning: pointer targets in passing argument 2 of 'add_next_index_stringl' differ in signedness
/home/bwiberg/rpm/BUILD/php-5.3.1/ext/standard/dns.c:507: warning: pointer targets in passing argument 4 of 'add_assoc_stringl_ex' differ in signedness
make: *** [ext/standard/dns.lo] Error 1
Bad exit status from /var/opt/freeware/tmp/rpm-tmp.19545 (%build)
bwiberg@melody-lp04:~/rpm/SPECS$ 

..using:
bwiberg@melody-lp04:~/rpm/SPECS$ less ../BUILD/php-5.3.1/config.nice 
#! /bin/sh
#
# Created by configure

LDFLAGS='-Wl,-bbigtoc' \
CC='gcc' \
'./configure' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-cli' \
'--enable-dba' \
'--enable-debug' \
'--enable-exif' \
'--enable-flatfile' \
'--enable-ftp' \
'--enable-gd-jis-conv' \
'--enable-gd-native-ttf' \
'--enable-inifile' \
'--enable-mbstring' \
'--enable-pcntl' \
'--enable-shmop' \
'--enable-soap' \
'--enable-sockets' \
'--enable-sqlite-utf8' \
'--enable-sysvmsg' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-wddx' \
'--enable-zip' \
'--enable-zend-multibyte' \
'--prefix=/apache/php' \
'--with-apxs2=/apache/bin/apxs' \
'--with-bz2' \
'--with-cdb' \
'--with-curl' \
'--with-freetype-dir' \
'--with-gd' \
'--with-gdbm' \
'--with-gettext' \
'--with-jpeg-dir' \
'--with-ldap' \
'--with-libxml-dir=/usr/local' \
'--with-mysql=mysqlnd' \
'--with-mysqli=mysqlnd' \
'--with-openssl=/opt/freeware' \
'--with-pdo-mysql=mysqlnd' \
'--with-png-dir' \
'--with-xmlrpc' \
'--with-xpm-dir' \
'--with-xsl' \
'--with-zlib' \
'--with-zlib-dir' \
"$@"
bwiberg@melody-lp04:~/rpm/SPECS$
 [2009-12-17 17:47 UTC] Bjorn dot Wiberg at its dot uu dot se
Suggested patch for 5.2.12:

*** php-5.2.12/ext/standard/dns.c       2009-10-16 18:09:49.000000000 +0200
--- php-5.2.12-my/ext/standard/dns.c    2009-12-17 18:10:55.000000000 +0100
***************
*** 56,63 ****
--- 56,65 ----
  #undef T_UNSPEC
  #endif
  #if HAVE_ARPA_NAMESER_COMPAT_H
+ #ifndef HAVE_ARPA_NAMESER_H
  #include <arpa/nameser_compat.h>
  #endif
+ #endif
  #if HAVE_ARPA_NAMESER_H
  #include <arpa/nameser.h>
  #endif

Suggested patch for PHP 5.3.1:

*** php-5.3.1/ext/standard/dns.c        2009-08-12 00:07:35.000000000 +0200
--- php-5.3.1-my/ext/standard/dns.c     2009-12-17 18:15:38.000000000 +0100
***************
*** 47,54 ****
--- 47,56 ----
  #include <arpa/nameser.h>
  #endif
  #if HAVE_ARPA_NAMESER_COMPAT_H
+ #ifndef HAVE_ARPA_NAMESER_H
  #include <arpa/nameser_compat.h>
  #endif
+ #endif
  #if HAVE_RESOLV_H
  #include <resolv.h>
  #endif
 [2009-12-18 00:36 UTC] jani@php.net
See also bug #50510 (same thing but with MacOSX)
 [2009-12-18 00:37 UTC] jani@php.net
btw. You always seem to report these just after the actual release. Why didn't you test the RCs..?
 [2009-12-18 05:10 UTC] Bjorn dot Wiberg at its dot uu dot se
Sorry about that -- I compiled and packaged 5.3.0 on AIX a couple of months ago but was not aware of the 5.3.1 release until yesterday (when visiting the download pages). We're planning to migrate to 5.3.x the upcoming spring.

At the moment we're running 5.2.11, which is working fine, so we did not anticipate any problems with 5.2.12 as it is a minor upgrade.
 [2009-12-18 05:13 UTC] Bjorn dot Wiberg at its dot uu dot se
As for 5.3.0, we actually did do the testing with the beta/release candidate versions prior to the release (and noticed and filed some bug reports). But for minor upgrades we haven't been hit very hard with severe bugs so far so usually stick with the releases (which often work fine).
 [2009-12-18 11:02 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=292283
Log: - Fixed bug #50508 (compile fails: Conflicting HEADER type declarations)
# NEVER ever include nameser_compat.h, it's included in various ways in different OSes by nameser.h if needed
 [2009-12-18 11:02 UTC] jani@php.net
Nevermind, fixed. :)
 [2009-12-21 15:22 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=292413
Log: - Tune the fix for bug #50508 and make it work with MacOSX, bug #50541.
 [2010-03-03 03:16 UTC] christiancaron at cooptel dot qc dot ca
i want a port and name or serveur
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC