#25930 [Com]: Can't compile snprintf.c
| From: | tony2001 at phpclub dot net | Date: | Tue, 21 Oct 2003 05:41:34 +0000 |
| Subject: | #25930 [Com]: Can't compile snprintf.c | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-49266@lists.php.net to get a copy of this message | ||
ID: 25930
Comment by: tony2001 at phpclub dot net
Reported By: adam at trachtenberg dot com
Status: Open
Bug Type: Compile Failure
Operating System: Mac OS X
PHP Version: 5CVS-2003-10-21 (dev)
New Comment:
Heh. You're not the only one, who suffering from this.
/root/CVS/php-src/main/spprintf.c: In function
`xbuf_format_converter':
/root/CVS/php-src/main/spprintf.c:365: error: parse error before
"uintmax_t"
/root/CVS/php-src/main/spprintf.c:407: error: parse error before
"intmax_t"
/root/CVS/php-src/main/spprintf.c:452: error: parse error before
"uintmax_t"
/root/CVS/php-src/main/spprintf.c:492: error: parse error before
"uintmax_t"
Same situation.
I've already told this at #php.bugs, but guys say, that this is not
PHP problem, but problem of my system.
To be honest, I don't think so.
I suppose the problem is rather stupid:
1) PHP uses uintmax_t, if SIZEOF_INTMAX_T > 0 (./configure detects,
that on my system it's equal to 8);
2) BUT PHP doesn't include definition of this type (it's in stdint.h).
3) PHP's ./configure _includes_ stdint.h implicitly (using inttypes.h),
so ./configure works well.
So, I've proposed to add to spprintf.c
#if SIZEOF_INTMAX_T
#include inttypes.h (or stdint.h, both of them solve the problem)
#endif
It seems, that guys do not agree with me, but they have not proposed
any other solution, rather then "check your system, the problem is in
it".
The one thing I didn't figured yet - why this problem appeared only on
Friday. I've changed nothing in my system (and php-src doesn't compile
on my servers too, but I didn't touch them at all).
The problem was found at least at these systems:
Linux 2.4.21, RH-based distrib, glibc-2.3.2, libtool-1.5,
autoconf-2.50, automake-1.5
Linux 2.4.18, RH-based distrib, glibc-2.2.5, libtool-1.5,
autoconf-2.50, automake-1.4-p5
In both cases:
config.log:3405:#define SIZEOF_INTMAX_T 8
and errors above.
Previous Comments:
------------------------------------------------------------------------
[2003-10-21 01:13:32] adam at trachtenberg dot com
Description:
------------
Trying to compile latest CVS on Mac OS X and PHP is
barfing on snprint.c. I think this comes from the
changes made on Sun Sep 14 05:12:54 2003.
Actual result:
--------------
gcc -Imain/ -I/usr/local/cvs/php/php-src/main/ -
DPHP_ATOM_INC -I/usr/local/cvs/php/php-src/include -I/
usr/local/cvs/php/php-src/main -I/usr/local/cvs/php/
php-src -I/usr/local/cvs/php/php-src/Zend -I/sw/include
-I/sw/include/libxml2 -I/usr/local/mysql/include -I/
usr/local/include -no-cpp-precomp -I/usr/local/cvs/
php/php-src/TSRM -g -Wall -c /usr/local/cvs/php/php-
src/main/snprintf.c -o main/snprintf.o && echo > main/
snprintf.lo
cc1: warning: changing search order for system
directory "/usr/local/include"
cc1: warning: as it has already been specified as a
non-system directory
/usr/local/cvs/php/php-src/main/snprintf.c: In function
`format_converter':
/usr/local/cvs/php/php-src/main/snprintf.c:750: parse
error before "uintmax_t"
/usr/local/cvs/php/php-src/main/snprintf.c:792: parse
error before "intmax_t"
/usr/local/cvs/php/php-src/main/snprintf.c:837: parse
error before "uintmax_t"
/usr/local/cvs/php/php-src/main/snprintf.c:877: parse
error before "uintmax_t"
/usr/local/cvs/php/php-src/main/snprintf.c:916:
warning: use of `long double' type; its size may change
in a future release
/usr/local/cvs/php/php-src/main/snprintf.c:916:
warning: (Long double usage is reported only once for
each file.
/usr/local/cvs/php/php-src/main/snprintf.c:916:
warning: To disable this warning, use -Wno-long-
double.)
make: *** [main/snprintf.lo] Error 1
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25930&edit=1