php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48450 Compile failure under IRIX 6.5.30 building gd.c
Submitted: 2009-06-02 06:48 UTC Modified: 2009-06-23 01:02 UTC
From: neko at nekochan dot net Assigned: kalle
Status: Closed Package: Compile Failure
PHP Version: 5.2.10RC1 OS: IRIX 6.5.30
Private report: No CVE-ID:
 [2009-06-02 06:48 UTC] neko at nekochan dot net
Description:
------------
Able to compile up to and including php-5.2.9 without error 
and run in a production environment. Attempt to build php-5.2.10RC1 
fails in ext/gd/libgd/gd.c (A value of type "int" cannot be assigned to 
an entity of type "gdImagePtr".)

IRIX64 Kazehana 6.5 6.5.30f 07202013 IP35
MIPSpro Compilers: Version 7.4.4m

Actual result:
--------------
/bin/sh /opt/build/php-5.2.10RC1/libtool --silent --preserve-dup-deps 
--mode=compile c99 -I/opt/build/php-5.2.10RC1/ext/gd/libgd -
DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_XPM -DHAVE_LIBFREETYPE -Iext/gd/ -
I/opt/build/php-5.2.10RC1/ext/gd/ -DPHP_ATOM_INC -I/opt/build/php-
5.2.10RC1/include -I/opt/build/php-5.2.10RC1/main -I/opt/build/php-
5.2.10RC1 -I/opt/build/php-5.2.10RC1/ext/date/lib -
I/usr/nekoware/include/libxml2 -I/usr/nekoware/include -
I/usr/nekoware/include/freetype2 -I/opt/build/php-
5.2.10RC1/ext/mbstring/oniguruma -I/opt/build/php-
5.2.10RC1/ext/mbstring/libmbfl -I/opt/build/php-
5.2.10RC1/ext/mbstring/libmbfl/mbfl -
I/usr/nekoware/mysql5/include/mysql -I/usr/nekoware/pgsql/include -
I/opt/build/php-5.2.10RC1/TSRM -I/opt/build/php-5.2.10RC1/Zend  -
D_XPG_IV -L/usr/nekoware/lib -L/usr/lib32  -I/usr/include -mips4 -O3 -
I/usr/nekoware/include -I/usr/include -Wl,-rpath -
Wl,/usr/nekoware/lib:/usr/nekoware/mysql5/lib/mysql -
OPT:Olimit=0:roundoff=3 -TARG:platform=IP35:proc=r16000   -c 
/opt/build/php-5.2.10RC1/ext/gd/libgd/gd.c -o ext/gd/libgd/gd.lo 

cc-1552 c99: WARNING File = /opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c, Line = 1802
  The variable "old_y1" is set but never used.

        int old_y1,old_y2;
            ^

cc-1552 c99: WARNING File = /opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c, Line = 2055
  The variable "tiled" is set but never used.

        int tiled;
            ^

cc-1552 c99: WARNING File = /opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c, Line = 2132
  The variable "half1" is set but never used.

        int half1 = 1;
            ^

cc-1552 c99: WARNING File = /opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c, Line = 2447
  The variable "accum" is set but never used.

        double accum;
               ^

cc-1552 c99: WARNING File = /opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c, Line = 2990
  The variable "f" is set but never used.

        FuncPtr f;
                ^

cc-1515 c99: ERROR File = /opt/build/php-5.2.10RC1/ext/gd/libgd/gd.c, 
Line = 3881
  A value of type "int" cannot be assigned to an entity of type 
"gdImagePtr".

        srctrans = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
                 ^

cc-1164 c99: ERROR File = /opt/build/php-5.2.10RC1/ext/gd/libgd/gd.c, 
Line = 3882
  Argument of type "gdImagePtr" is incompatible with parameter of type 
"int".

        gdImageFill(srcback, 0, 0, srctrans);
                                   ^

2 errors detected in the compilation of "/opt/build/php-
5.2.10RC1/ext/gd/libgd/gd.c".
gmake: *** [ext/gd/libgd/gd.lo] Error 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-02 12:37 UTC] kalle@php.net
Try the following patch, because a wrongly patch was initially applied, making the result of gdImageColorAllocateAlpha being assigned to a gdImagePtr instead of int.

Index: gd.c
===================================================================
RCS file: /repository/php-src/ext/gd/libgd/gd.c,v
retrieving revision 1.90.2.1.2.26
diff -u -r1.90.2.1.2.26 gd.c
--- gd.c	23 Apr 2009 16:28:39 -0000	1.90.2.1.2.26
+++ gd.c	2 Jun 2009 12:36:00 -0000
@@ -3864,7 +3864,7 @@
 	int         x, y, i, j, new_a;
 	float       new_r, new_g, new_b;
 	int         new_pxl, pxl=0;
-	gdImagePtr  srcback, srctrans;
+	gdImagePtr  srcback;
 	typedef int (*FuncPtr)(gdImagePtr, int, int);
 	FuncPtr f;
 
@@ -3878,8 +3878,8 @@
 		return 0;
 	}
 	srcback->saveAlphaFlag = 1;
-	srctrans = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
-	gdImageFill(srcback, 0, 0, srctrans);
+	new_pxl = gdImageColorAllocateAlpha(srcback, 0, 0, 0, 127);
+	gdImageFill(srcback, 0, 0, new_pxl;
 
 	gdImageCopy(srcback, src,0,0,0,0,src->sx,src->sy);
 


 [2009-06-02 17:11 UTC] neko at nekochan dot net
The patch clears the issue, though there's a missing closing parenthesis 
on the final line:

+       gdImageFill(srcback, 0, 0, new_pxl);
 [2009-06-23 01:01 UTC] kalle@php.net
Fixed in cvs, however the fix isn't correct due to a wrong patch in first place. To follow the real bug see bug #47946
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 00:02:04 2014 UTC