php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53107 undeclared identifer: strcasecmp not always in string.h
Submitted: 2010-10-19 22:50 UTC Modified: 2013-02-18 00:34 UTC
From: mamfelt at gmail dot com Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 5.2.14 OS: AIX 4.3.3
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-10-19 22:50 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-19 23:04 UTC] 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 23:09 UTC] pajoye@php.net
-Status: Open +Status: Feedback
 [2010-10-19 23:09 UTC] 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.
 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC