[PHP-DEV] Bug #7474 Updated: ext/standard/scanf.c reports strtol/strtoul undefined reference
ID: 7474 Updated by: sniper Reported By: [EMAIL PROTECTED] Old Status: Analyzed Status: Closed Bug Type: Compile Failure Operating System: SunOs 4.1.4 (!) PHP Version: 4.0.5 ? New Comment: As this system in question is really outdated and shouldn't be used in production anyway (y2k!) we're not going to add any hacks to fix this now. I have made patches to fix this, so if someone else has the same problem and really wants this hack, it's available by asking me: [EMAIL PROTECTED] --Jani Previous Comments: [2001-06-18 20:13:42] [EMAIL PROTECTED] This was said to happen still with 4.0.5 and the code in question hasn't changed (IIRC) much since. One possible solution is to add some #ifdef's around these functions, and checks for existance of strol/stroul into configure [2001-06-02 20:51:40] [EMAIL PROTECTED] If you don't mind, please test latest release candidate: http://www.php.net/~andi/php-4.0.6RC2.tar.gz I'm pretty sure it happens with it too, but I'd like to be sure about it. -Jani [2001-05-23 02:04:47] [EMAIL PROTECTED] I guess this still happens with PHP 4.0.5 too? --Jani [2001-01-16 19:50:46] [EMAIL PROTECTED] The snapshot of 200101160445 failed to compile with the same error as that of 4.0.4pl1. [2001-01-16 08:03:14] [EMAIL PROTECTED] I just tried to compile 4.0.4pl1 and it failed the same way: gcc -I. [snip] -c scanf.c touch scanf.lo scanf.c: In function `php_sscanf_internal': scanf.c:783: `strtol' undeclared (first use this function) scanf.c:783: (Each undeclared identifier is reported only once scanf.c:783: for each function it appears in.) scanf.c:804: `strtoul' undeclared (first use this function) *** Error code 1 I'll try a snapshot next. Thanks - Larry The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/?id=7474 Edit this bug report at http://bugs.php.net/?id=7474edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #7474 Updated: ext/standard/scanf.c reports strtol/strtoul undefined reference
ID: 7474 Updated by: sniper Reported By: [EMAIL PROTECTED] Old-Status: Feedback Status: Analyzed Bug Type: Compile Failure Operating system: PHP Version: 4.0.5 ? Assigned To: Comments: This was said to happen still with 4.0.5 and the code in question hasn't changed (IIRC) much since. One possible solution is to add some #ifdef's around these functions, and checks for existance of strol/stroul into configure Previous Comments: --- [2001-06-02 20:51:40] [EMAIL PROTECTED] If you don't mind, please test latest release candidate: http://www.php.net/~andi/php-4.0.6RC2.tar.gz I'm pretty sure it happens with it too, but I'd like to be sure about it. -Jani --- [2001-05-23 02:04:47] [EMAIL PROTECTED] I guess this still happens with PHP 4.0.5 too? --Jani --- [2001-01-16 19:50:46] [EMAIL PROTECTED] The snapshot of 200101160445 failed to compile with the same error as that of 4.0.4pl1. --- [2001-01-16 08:03:14] [EMAIL PROTECTED] I just tried to compile 4.0.4pl1 and it failed the same way: gcc -I. [snip] -c scanf.c touch scanf.lo scanf.c: In function `php_sscanf_internal': scanf.c:783: `strtol' undeclared (first use this function) scanf.c:783: (Each undeclared identifier is reported only once scanf.c:783: for each function it appears in.) scanf.c:804: `strtoul' undeclared (first use this function) *** Error code 1 I'll try a snapshot next. Thanks - Larry --- [2000-12-18 10:44:07] [EMAIL PROTECTED] Does this happen with latest snapshot from http://snaps.php.net/ ?? --Jani --- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=7474edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-DEV] Bug #7474 Updated: ext/standard/scanf.c reports strtol/strtoul undefined reference
ID: 7474 Updated by: sniper Reported By: [EMAIL PROTECTED] Old-Status: Open Status: Feedback Bug Type: Compile Failure Operating system: PHP Version: 4.0.5 ? Assigned To: Comments: I guess this still happens with PHP 4.0.5 too? --Jani Previous Comments: --- [2001-01-16 19:50:46] [EMAIL PROTECTED] The snapshot of 200101160445 failed to compile with the same error as that of 4.0.4pl1. --- [2001-01-16 08:03:14] [EMAIL PROTECTED] I just tried to compile 4.0.4pl1 and it failed the same way: gcc -I. [snip] -c scanf.c touch scanf.lo scanf.c: In function `php_sscanf_internal': scanf.c:783: `strtol' undeclared (first use this function) scanf.c:783: (Each undeclared identifier is reported only once scanf.c:783: for each function it appears in.) scanf.c:804: `strtoul' undeclared (first use this function) *** Error code 1 I'll try a snapshot next. Thanks - Larry --- [2000-12-18 10:44:07] [EMAIL PROTECTED] Does this happen with latest snapshot from http://snaps.php.net/ ?? --Jani --- [2000-10-26 00:42:20] [EMAIL PROTECTED] I went through and found all the files that use strtol without type-casting. They are: ./ext/dbase/dbase.c ./ext/session/mod_files.c ./ext/standard/formatted_print.c ./ext/standard/scanf.c ./ext/standard/string.c ./ext/wddx/wddx.c ./main/fopen-wrappers.c ./main/php_ini.c ./sapi/nsapi/nsapi.c ./Zend/zend_operators.c ./Zend/zend_operators.h ./Zend/zend-scanner.c I added the first set of function prototypes in my first message (the ones that are commented out) to each of the above files, except that the last 3 files required ulong to be spelled out as unsigned long for strtoul. The others took ulong OK. The compile was successful. Now let's see if php4 works. I'm sending this now because it may take a while for any bugs related to this fix to appear. Thanks again for your hard work. I hope these comments help the next poor soul who is still working with SunOs 4.1.4. --- [2000-10-26 00:07:37] [EMAIL PROTECTED] SunOs 4.1.4 has strtol (at least, the man page for it). And, ext/mysql/libmysql has a replacement for strtol/strtoul. But, the out of the box compile fails in ext/standard/scanf.c with the complaint: strtol/strtoul are undefined references. I tried to cut and paste from the files in ext/mysql/libmysql but got a zillion compiler errors. Then, I added the following to the start of scanf.c based on the SunOs man page: long strtol( char *str, char **ptr, int base ); ulong strtoul( char *str, char **ptr, int base ); The compile succeeded, but complained that these functions had been defined as int implicitly in ./Zend/zend_operators.c. I then changed the added lines to int strtol( char *str, char **ptr, int base ); int strtoul( char *str, char **ptr, int base ); These lines allowed the file to compile without warnings, and the rest of the php4 compile proceeded smoothly. I guess I'll just have to see whether I should have gone through the entire package and defined these functions as long/ulong everywhere instead of making them int in this one file. I don't know how best to handle this idiosyncracy in the php4 package. I searched everything in /usr/include for definitions of strtol and strtoul, but couldn't find any files that define them. Maybe you could include a short .h file with these definitions, or add them to a global file for those systems that don't define these right. Thanks for all your hard work! - Larry Widman --- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=7474edit=2 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]