php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46460 recent macro introduction breaks compile with CodeWarrior
Submitted: 2008-11-01 22:23 UTC Modified: 2008-11-01 23:10 UTC
From: guenter@php.net Assigned: jani (profile)
Status: Closed Package: Gettext related
PHP Version: 5.2CVS-2008-11-01 (snap) OS: NetWare, most likely Win32
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guenter@php.net
New email:
PHP Version: OS:

 

 [2008-11-01 22:23 UTC] guenter@php.net
Description:
------------
The recent changes to gettext.c break NetWare with CodeWarrior.
The culprit are the macro defines which in turn when used declare vars int check_len and char *check_name in the middle of the code.
This is illegal for many non-gcc compilers, and from my experience I assume this will also break Win32/MSVC most likely beside NetWare/CodeWarrior.
As workaround the vars can be declared global;
although I'm not fine with this - but it works:

--- gettext.c.orig	Thu Oct 30 16:38:02 2008
+++ gettext.c	Sat Nov 01 23:19:08 2008
@@ -144,6 +144,9 @@
 ZEND_GET_MODULE(php_gettext)
 #endif
 
+static int check_len;
+static char *check_name;
+
 #define PHP_GETTEXT_MAX_DOMAIN_LENGTH 1024
 #define PHP_GETTEXT_MAX_MSGID_LENGTH 4096
 
@@ -154,8 +157,8 @@
 	}
 
 #define PHP_GETTEXT_MSGID_LENGTH_CHECK \
-	char *check_name = "msgid"; \
-	int check_len   = msgid_len; \
+	check_name = "msgid"; \
+	check_len  = msgid_len; \
 	PHP_GETTEXT_LENGTH_CHECK
 
 #define PHP_GETTEXT_LENGTH_CHECK \
@@ -165,8 +168,6 @@
 	}
 
 #define PHP_GETTEXT_MULTI_MSGID_LENGTH_CHECK \
-	int check_len; \
-	char *check_name; \
 	check_name = "msgid1"; \
 	check_len = msgid1_len; \
 	PHP_GETTEXT_LENGTH_CHECK \



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-01 23:01 UTC] jani@php.net
Something simple was made into something overly complex..I'm testing 
a fix now.
 [2008-11-01 23:10 UTC] jani@php.net
This bug has been fixed in CVS.

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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 23:01:27 2024 UTC