php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25930 Can't compile snprintf.c
Submitted: 2003-10-21 01:13 UTC Modified: 2003-10-21 03:36 UTC
From: adam at trachtenberg dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5CVS-2003-10-21 (dev) OS: Mac OS X
Private report: No CVE-ID: None
 [2003-10-21 01:13 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-21 01:41 UTC] tony2001 at phpclub dot net
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.
 [2003-10-21 03:36 UTC] helly@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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 09:01:28 2024 UTC