|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32538 ext/swf/swf.c does not compile with gcc-3.4.x or newer
Submitted: 2005-04-01 21:01 UTC Modified: 2005-04-02 08:03 UTC
From: adam dot greenfield at gmail dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.11 OS: Linux (Fedora Core 3)
Private report: No CVE-ID:
 [2005-04-01 21:01 UTC] adam dot greenfield at gmail dot com
PHP 4.3.11 will not compile on machines using gcc-3.4.x (in this case, gcc-3.4.2)

Reproduce code:
kronos% ./configure --with-swf=/usr
... (normal configure output - no errors) ...
kronos% make
... (normal make output) ...
gcc  -Iext/swf/ -I/home/adam/build/packages/dsmphp/php-4.3.11/ext/swf/ -DPHP_ATOM_INC -I/home/adam/build/packages/dsmphp/php-4.3.11/include -I/home/adam/build/packages/dsmphp/php-4.3.11/main -I/home/adam/build/packages/dsmphp/php-4.3.11 -I/home/adam/build/packages/dsmphp/php-4.3.11/ext/xml/expat -I/home/adam/build/packages/dsmphp/php-4.3.11/TSRM -I/home/adam/build/packages/dsmphp/php-4.3.11/Zend   -g -O2  -c /home/adam/build/packages/dsmphp/php-4.3.11/ext/swf/swf.c -o ext/swf/swf.o  && echo > ext/swf/swf.lo
/home/adam/build/packages/dsmphp/php-4.3.11/ext/swf/swf.c: In function `zif_swf_openfile':
/home/adam/build/packages/dsmphp/php-4.3.11/ext/swf/swf.c:256: error: label at end of compound statement
make: *** [ext/swf/swf.lo] Error 1

Expected result:
PHP Compiles

Actual result:
Compile failed


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-01 21:03 UTC] adam dot greenfield at gmail dot com
Here is a patch I've made, it corrected this issue on my systems:

diff -Naur php-4.3.11.orig/ext/swf/swf.c php-4.3.11/ext/swf/swf.c
--- php-4.3.11.orig/ext/swf/swf.c       2004-12-23 13:29:36.000000000 -0500
+++ php-4.3.11/ext/swf/swf.c    2005-04-01 13:32:16.540010608 -0500
@@ -240,7 +240,10 @@
        na = tmpna;
        if (php_check_open_basedir(na TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(na, "wb+", CHECKUID_CHECK_MODE_PARAM))) {
-               goto err;
+           free(na);
+               return;

        if (!SWFG(use_file))
@@ -249,10 +252,6 @@
        swf_openfile(na,(float)Z_DVAL_PP(sizeX), (float)Z_DVAL_PP(sizeY),
                         (float)Z_DVAL_PP(frameRate), (float)Z_DVAL_PP(r),
                         (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b));
-       free(na);
 /* }}} */
 [2005-04-01 21:27 UTC] adam dot greenfield at gmail dot com
After seeking advice on the best way to submit patches, I've made a diff -dpu patch of swf.c and posted it at
 [2005-04-02 08:03 UTC]
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
Thank you for the report, and for helping us make PHP better.

And you really should use anything else than this extension..
for example ext/ming

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 17:01:31 2015 UTC