php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59357 Cannot install on CentOS
Submitted: 2010-08-10 07:49 UTC Modified: 2011-06-27 05:38 UTC
From: sylvain dot lecoy at gmail dot com Assigned:
Status: Closed Package: rar (PECL)
PHP Version: 5.2.6 OS: CentOS 5.0
Private report: No CVE-ID: None
 [2010-08-10 07:49 UTC] sylvain dot lecoy at gmail dot com
Description:
------------
On PECL install RAR, I get the following error after trying to 
compile:

make: *** [rararch.lo] Error 1
ERROR: `make' failed

This caused by this:

/var/cache/php-pear/rar-2.0.0/rararch.c:330: error: static 
declaration of 'strnlen' follows non-static declaration
/usr/include/string.h:250: error: previous declaration of 
'strnlen' was here

I put the whole make report in the Actual result textarea.

Actual result:
--------------
running: make
/bin/sh /var/tmp/pear-build-root/rar-2.0.0/libtool --
mode=compile gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings 
-I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -
DHAVE_CONFIG_H  -g -O2   -c /var/cache/php-pear/rar-
2.0.0/rar.c -o rar.lo
mkdir .libs
 gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings -
I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib -
DHAVE_CONFIG_H -g -O2 -c /var/cache/php-pear/rar-2.0.0/rar.c  
-fPIC -DPIC -o .libs/rar.o
/var/cache/php-pear/rar-2.0.0/rar.c:287: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar.c:288: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar.c:289: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar.c:290: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar.c:291: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar.c:292: warning: 
initialization discards qualifiers from pointer target type
/bin/sh /var/tmp/pear-build-root/rar-2.0.0/libtool --
mode=compile gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings 
-I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -
DHAVE_CONFIG_H  -g -O2   -c /var/cache/php-pear/rar-
2.0.0/rar_error.c -o rar_error.lo
 gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings -
I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib -
DHAVE_CONFIG_H -g -O2 -c /var/cache/php-pear/rar-
2.0.0/rar_error.c  -fPIC -DPIC -o .libs/rar_error.o
/var/cache/php-pear/rar-2.0.0/rar_error.c:212: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rar_error.c:213: warning: 
initialization discards qualifiers from pointer target type
/bin/sh /var/tmp/pear-build-root/rar-2.0.0/libtool --
mode=compile gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings 
-I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib  -
DHAVE_CONFIG_H  -g -O2   -c /var/cache/php-pear/rar-
2.0.0/rararch.c -o rararch.lo
 gcc -DRARDLL -DGUI -DSILENT -Wno-write-strings -
I/var/cache/php-pear/rar-2.0.0/unrar -I. -I/var/cache/php-
pear/rar-2.0.0 -DPHP_ATOM_INC -I/var/tmp/pear-build-
root/rar-2.0.0/include -I/var/tmp/pear-build-root/rar-
2.0.0/main -I/var/cache/php-pear/rar-2.0.0 -
I/usr/include/php -I/usr/include/php/main -
I/usr/include/php/TSRM -I/usr/include/php/Zend -
I/usr/include/php/ext -I/usr/include/php/ext/date/lib -
DHAVE_CONFIG_H -g -O2 -c /var/cache/php-pear/rar-
2.0.0/rararch.c  -fPIC -DPIC -o .libs/rararch.o
/var/cache/php-pear/rar-2.0.0/rararch.c: In function 
'_rar_raw_entries_to_files':
/var/cache/php-pear/rar-2.0.0/rararch.c:241: warning: left 
shift count >= width of type
/var/cache/php-pear/rar-2.0.0/rararch.c: At top level:
/var/cache/php-pear/rar-2.0.0/rararch.c:330: error: static 
declaration of 'strnlen' follows non-static declaration
/usr/include/string.h:250: error: previous declaration of 
'strnlen' was here
/var/cache/php-pear/rar-2.0.0/rararch.c:629: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:630: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:631: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:635: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:636: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:637: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:638: warning: 
initialization discards qualifiers from pointer target type
/var/cache/php-pear/rar-2.0.0/rararch.c:639: warning: 
initialization discards qualifiers from pointer target type


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-27 11:26 UTC] cataphract@php.net
This is strange, because the only way this can happen is if HAVE_STRNLEN is 0, yet strnlen exists. I have no way to test this in CentOS short of installing it, but I can't reproduce it in Ubuntu 10.4.

The PHP source does exactly the same with this macro. See http://lxr.php.net/opengrok/xref/PHP_5_2/main/spprintf.c#184

In any case, this problem should not break the build in trunk. Try to install it instead:

svn co https://svn.php.net/repository/pecl/rar/trunk rar && cd rar && phpize && ./configure && make && sudo make install
 [2011-06-27 05:38 UTC] cataphract@php.net
Most likely not a problem in 3.0.0 anymore.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 21 00:01:24 2020 UTC