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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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: Sat Dec 21 17:01:58 2024 UTC