php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64710 Implicit function declaration and unused variables in gd.c
Submitted: 2013-04-25 18:08 UTC Modified: 2014-03-12 16:30 UTC
From: sixd@php.net Assigned: pajoye (profile)
Status: Closed Package: GD related
PHP Version: 5.5.0beta4 OS: Ubuntu 12.04
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: sixd@php.net
New email:
PHP Version: OS:

 

 [2013-04-25 18:08 UTC] sixd@php.net
Description:
------------
Compiling gd.c gives these warnings:

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c: In function 
‘zif_imageloadfont’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:1656:2: warning: implicit 
declaration of function ‘overflow2’ [-Wimplicit-function-declaration]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c: In function 
‘php_gd__gdImageFillTiled’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c:1961:6: warning: variable 
‘tiled’ set but not used [-Wunused-but-set-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c: In function 
‘php_gd_gdImageRectangle’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c:2038:6: warning: variable 
‘half1’ set but not used [-Wunused-but-set-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c: In function ‘zif_imagecrop’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5263:9: warning: unused variable 
‘threshold’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5262:7: warning: unused variable 
‘color’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5261:7: warning: unused variable 
‘mode’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c: In function ‘zif_imagescale’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c: In function 
‘php_gd_gdImageCopyResized’:/home/cjones/Desktop/php-
5.5.0beta4/ext/gd/gd.c:5369:9: warning: unused variable ‘threshold’ [-Wunused-
variable]

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c:2359:9: warning: variable 
‘accum’ set but not used [-Wunused-but-set-variable]/home/cjones/Desktop/php-
5.5.0beta4/ext/gd/gd.c:5368:7: warning: unused variable ‘color’ [-Wunused-
variable]

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5367:7: warning: unused variable 
‘mode’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c: In function ‘zif_imageaffine’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5420:9: warning: unused variable 
‘threshold’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5419:7: warning: unused variable 
‘color’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5418:7: warning: unused variable 
‘mode’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c: In function 
‘zif_imageaffinematrixget’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/gd.c:5526:6: warning: variable ‘res’ 
set but not used [-Wunused-but-set-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c: In function 
‘gdImagePaletteToTrueColor’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c:3020:29: warning: unused 
variable ‘alloc_aa’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd.c:3020:16: warning: unused 
variable ‘alloc_y’ [-Wunused-variable]

My 'configure' options were:
'--with-gd' \
'--with-curl' \
'--with-jpeg-dir' \
'--with-png-dir' \
'--enable-gd-native-ttf' \



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-25 18:08 UTC] sixd@php.net
-Summary: Implicit function declaratiion and unused variables in gd.c +Summary: Implicit function declaration and unused variables in gd.c
 [2013-04-25 18:35 UTC] sixd@php.net
There are similar issues in some of the libgd functions:

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gdhelpers.c: In function 
‘php_gd_gd_strtok_r’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gdhelpers.c:18:9: warning: 
variable ‘start’ set but not used [-Wunused-but-set-variable]

and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_gif_in.c: In function 
‘php_gd_gdImageCreateFromGifCtx’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_gif_in.c:139:18: warning: 
variable ‘gif87a’ set but not used [-Wunused-but-set-variable]

and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_gif_out.c: In function 
‘php_gd_gdImageGifCtx’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_gif_out.c:120:6: warning: 
variable ‘interlace’ set but not used [-Wunused-but-set-variable]

and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_arc.c: In function 
‘php_gd_gdImageFilledEllipse’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_arc.c:61:6: warning: 
variable ‘old_y1’ set but not used [-Wunused-but-set-variable]

and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_rotate.c: In function 
‘php_gd_gdImageRotate45’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_rotate.c:351:10: warning: 
variable ‘f’ set but not used [-Wunused-but-set-variable]


and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_crop.c: In function 
‘gdImageCropAuto’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_crop.c:109:13: warning: 
variable ‘corners’ set but not used [-Wunused-but-set-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_crop.c: In function 
‘gdColorMatch’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_crop.c:340:2: warning: 
suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_crop.c:340:2: warning: 
suggest parentheses around arithmetic in operand of ‘^’ [-Wparentheses]

and

/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: In function 
‘_gdScaleRow’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:981:10: 
warning: type defaults to ‘int’ in declaration of ‘left_channel’ [-Wimplicit-
int]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: In function 
‘_gdScaleCol’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:1023:8: 
warning: unused variable ‘row’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: In function 
‘gdImageScaleBilinearTC’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:1306:6: 
warning: variable ‘dwSrcTotalOffset’ set but not used [-Wunused-but-set-
variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: In function 
‘gdImageRotateGeneric’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:1766:13: 
warning: unused variable ‘f_127’ [-Wunused-variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: In function 
‘gdTransformAffineCopy’:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:2343:23: 
warning: variable ‘interpolation_bak’ set but not used [-Wunused-but-set-
variable]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c: At top 
level:
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:358:15: 
warning: ‘filter_cubic_spline’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:374:15: 
warning: ‘filter_cubic_convolution’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:409:15: 
warning: ‘filter_filter’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:419:15: 
warning: ‘filter_lanczos8’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:435:15: 
warning: ‘filter_lanczos3’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:507:15: 
warning: ‘filter_cosine’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:545:15: 
warning: ‘filter_quadratic_bspline’ defined but not used [-Wunused-function]
/home/cjones/Desktop/php-5.5.0beta4/ext/gd/libgd/gd_interpolation.c:594:15: 
warning: ‘filter_welsh’ defined but not used [-Wunused-function]
 [2013-04-26 06:16 UTC] pajoye@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.


 [2013-04-26 06:16 UTC] pajoye@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: pajoye
 [2013-05-01 21:36 UTC] sixd@php.net
Re-opening as per IRC discussion with Pierre.

The following warnings are still outstanding in PHP 5.5 from git:

/home/cjones/php-5.5/ext/gd/libgd/gd.c:3014: warning: unused variable ‘alloc_y’

and:

/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:1023: warning: unused variable ‘row’
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:1766: warning: unused variable ‘f_127’
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:359: warning: ‘filter_cubic_spline’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:375: warning: ‘filter_cubic_convolution’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:410: warning: ‘filter_filter’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:420: warning: ‘filter_lanczos8’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:436: warning: ‘filter_lanczos3’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:508: warning: ‘filter_cosine’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:546: warning: ‘filter_quadratic_bspline’ defined but not used
/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:595: warning: ‘filter_welsh’ defined but not used
 [2013-05-01 21:36 UTC] sixd@php.net
-Status: Closed +Status: Re-Opened
 [2014-03-12 16:30 UTC] sixd@php.net
-Status: Re-Opened +Status: Closed
 [2014-03-12 16:30 UTC] sixd@php.net
gd.c currently compiles without warnings in PHP 5.5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 08:01:28 2025 UTC