Bug #53107 [Fbk->NoF]: undeclared identifer: strcasecmp not always in string.h
| From: | php-bugs at lists dot php dot net | Date: | Mon, 18 Feb 2013 00:34:32 +0000 |
| Subject: | Bug #53107 [Fbk->NoF]: undeclared identifer: strcasecmp not always in string.h | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176922@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53107&edit=1
ID: 53107
Updated by: php-bugs@lists.php.net
Reported by: mamfelt at gmail dot com
Summary: undeclared identifer: strcasecmp not always in
string.h
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Compile Failure
Operating System: AIX 4.3.3
PHP Version: 5.2.14
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2010-10-19 23:09:35] pajoye@php.net
the fix sounds wrong if earlier version of AIX has it in string.h, as it always includes strings.h.
I would suggest to add a test for this function in configure.ac (as we can use it everywhere in
PHP). Adding the necessary iteration for AIX (using string.h and then strings.h on failure.
------------------------------------------------------------------------
[2010-10-19 23:04:08] mamfelt at gmail dot com
Sorry, dont know how to make a patch - keeps saying it is text/lisp or v.v.
My suggestion:
in file add ext/zip/lib/zip_name_locate.c near line 34
^L
#include <string.h>
#ifdef AIX433
#include <strings.h>
#endif
and add -DAIX433 to CFLAGS before starting ./configure (if it is not done automaically already)
------------------------------------------------------------------------
[2010-10-19 22:50:09] mamfelt at gmail dot com
Description:
------------
# ./configure ... --enable-zip ...
# make
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c: In function `_zip_name_locate':
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: `strcasecmp' undeclared (first
use in this function)
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: (Each undeclared identifier is
reported only once
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: for each function it appears in.)
make: *** [ext/zip/lib/zip_name_locate.lo] Error 1
Test script:
---------------
PATCH? or TEST?
This is only with AIX433. AIX 5.1 and beyond has strcasecmp defined in <string.h>. I do not
know if ./configure would add an AIX433 somewhere to make it automatic to add strings.h.
I am able to fix it with:
File: ext/zip/lib/zip_name_locate.c
+34 ^L
+35
+36 #include <string.h>
+37 #ifdef _AIX
+38 /* for AIX433 actually! */
+39 #include <strings.h>
+40 #endif
+41
+42 #include "zipint.h"
+43
+44 ^L
Expected result:
----------------
successful build.
Actual result:
--------------
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c: In function `_zip_name_locate':
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: `strcasecmp' undeclared (first
use in this function)
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: (Each undeclared identifier is
reported only once
/data/prj/php-5.2.14/ext/zip/lib/zip_name_locate.c:67: error: for each function it appears in.)
make: *** [ext/zip/lib/zip_name_locate.lo] Error 1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53107&edit=1