#48872 [Asn->Csd]: string.c: errors: duplicate case values
| From: | kalle@php.net | Date: | Mon, 27 Jul 2009 07:14:47 +0000 |
| Subject: | #48872 [Asn->Csd]: string.c: errors: duplicate case values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-140310@lists.php.net to get a copy of this message | ||
ID: 48872
Updated by: kalle@php.net
Reported By: nospam at hjcms dot de
-Status: Assigned
+Status: Closed
Bug Type: Compile Failure
Operating System: Linux
PHP Version: 5.3.0
Assigned To: kalle
New Comment:
This bug has been fixed in SVN.
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/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-07-27 07:14:40] svn@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=286386
Log: Fixed bug #48872 (string.c: errors: duplicate case values) (Only
in PHP_5_3)
------------------------------------------------------------------------
[2009-07-22 20:22:22] jani@php.net
Kalle, why don't you just commit that? Those macros are duplicates
anyway and deprecated, IIRC. Shouldn't break anything.
------------------------------------------------------------------------
[2009-07-17 23:53:46] kalle@php.net
I guess something in the way of this should do:
Index: string.c
===================================================================
--- string.c (revision 284196)
+++ string.c (working copy)
@@ -587,14 +587,12 @@
#endif
#ifdef DECIMAL_POINT
case DECIMAL_POINT:
-#endif
-#ifdef RADIXCHAR
+#elif defined(RADIXCHAR)
case RADIXCHAR:
#endif
#ifdef THOUSANDS_SEP
case THOUSANDS_SEP:
-#endif
-#ifdef THOUSEP
+#elif defined(THOUSEP)
case THOUSEP:
#endif
#ifdef GROUPING
------------------------------------------------------------------------
[2009-07-10 18:45:42] jani@php.net
From http://www.gnu.org/s/libc/manual/html_node/The-Elegant-and-Fast-
Way.html:
"
DECIMAL_POINT
RADIXCHAR
The same as the value returned by localeconv in the decimal_point
element of the struct lconv.
The name RADIXCHAR is a deprecated alias still used in Unix98.
THOUSANDS_SEP
THOUSEP
The same as the value returned by localeconv in the thousands_sep
element of the struct lconv.
The name THOUSEP is a deprecated alias still used in Unix98.
"
For some reason these aren't handled with #ifdef's in the code..
------------------------------------------------------------------------
[2009-07-09 15:32:20] nospam at hjcms dot de
Description:
------------
-c /usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c -o
ext/standard/string.lo
/usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c: In
function 'zif_nl_langinfo':
/usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c:592: error:
duplicate case value
/usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c:589: error:
previously used here
/usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c:598: error:
duplicate case value
/usr/src/packages/BUILD/php-5.3.0/ext/standard/string.c:595: error:
previously used here
gmake: *** [ext/standard/string.lo] Fehler 1
Reproduce code:
---------------
#ifdef DECIMAL_POINT
case DECIMAL_POINT:
#endif
#ifdef RADIXCHAR
case RADIXCHAR:
#endif
#ifdef THOUSANDS_SEP
case THOUSANDS_SEP:
#endif
#ifdef THOUSEP
case THOUSEP:
#endif
Expected result:
----------------
case mismatch with glibc 2.10.1
rpm -qf /usr/include/langinfo.h
glibc-devel-2.10.1-2009154
Actual result:
--------------
grep --color=auto -e DECIMAL_POINT -e RADIXCHAR -e THOUSANDS_SEP -e
THOUSEP /usr/include/langinfo.h
__MON_DECIMAL_POINT,
# define MON_DECIMAL_POINT __MON_DECIMAL_POINT
__MON_THOUSANDS_SEP,
# define MON_THOUSANDS_SEP __MON_THOUSANDS_SEP
_NL_MONETARY_DECIMAL_POINT_WC,
_NL_MONETARY_THOUSANDS_SEP_WC,
__DECIMAL_POINT = _NL_ITEM (__LC_NUMERIC, 0),
# define DECIMAL_POINT __DECIMAL_POINT
RADIXCHAR = __DECIMAL_POINT,
#define RADIXCHAR RADIXCHAR
__THOUSANDS_SEP,
# define THOUSANDS_SEP __THOUSANDS_SEP
THOUSEP = __THOUSANDS_SEP,
#define THOUSEP THOUSEP
_NL_NUMERIC_DECIMAL_POINT_WC,
_NL_NUMERIC_THOUSANDS_SEP_WC,
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48872&edit=1