php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58317 runkit_import.c doesn't compile on strict C
Submitted: 2008-08-18 13:21 UTC Modified: 2013-02-23 11:19 UTC
From: Keisial at gmail dot com Assigned: pollita (profile)
Status: Closed Package: runkit (PECL)
PHP Version: 5_2 CVS-2008-08-18 (dev) OS: Windows
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Keisial at gmail dot com
New email:
PHP Version: OS:

 

 [2008-08-18 13:21 UTC] Keisial at gmail dot com
Description:
------------
runkit_import.c defines two variables on lines 65 and 66 after actual code. Although it's not required by Ansi C, gcc compiles that case fine (unless the -pedantic switch is passed), but other compilers (eg. Visual C++) doesn't.
In order to build it with Visual C++ you need to declare the variable before:


Index: runkit_import.c
===================================================================
RCS file: /repository/pecl/runkit/runkit_import.c,v
retrieving revision 1.11
diff -u -r1.11 runkit_import.c
--- runkit_import.c	5 May 2008 04:28:34 -0000	1.11
+++ runkit_import.c	18 Aug 2008 17:09:33 -0000
@@ -59,11 +59,13 @@
 		}

 		if (add_function) {
+			char *lcase;
+			int lcase_len;
 			PHP_RUNKIT_FUNCTION_ADD_REF(fe);


-			char *lcase = estrdup(fe->common.function_name);
-			int lcase_len = strlen(lcase);
+			lcase = estrdup(fe->common.function_name);
+			lcase_len = strlen(lcase);

 			php_strtolower(lcase, lcase_len);
 			if (zend_hash_add(EG(function_table), lcase, lcase_len + 1, fe, sizeof(zend_function), NULL) == FAILURE) {



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-23 11:19 UTC] pollita@php.net
The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

Fixed in my local git, at least... will push later today. Thanks! :)
 [2013-02-23 11:19 UTC] pollita@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pollita
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 11:01:29 2024 UTC