Bug 79640 - undefined behavior C statements in Imlib
undefined behavior C statements in Imlib
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: imlib (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jonathan Blandford
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-14 05:42 EST by d.binderman
Modified: 2013-04-02 00:17 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-08 00:39:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2002-12-14 05:42:03 EST
Description of problem:

Hello there,

I just tried to compile package imlib-1.9.13-9 from Redhat 8.0.

Here are some of the compiler messages.

io-ppm.c:179: warning: operation on `a' may be undefined
io-ppm.c:180: warning: operation on `a' may be undefined
io-ppm.c:197: warning: operation on `a' may be undefined
io-ppm.c:198: warning: operation on `a' may be undefined
load.c:1467: warning: operation on `a' may be undefined
load.c:1468: warning: operation on `a' may be undefined
load.c:1485: warning: operation on `a' may be undefined
load.c:1486: warning: operation on `a' may be undefined

Here is a patch which shuts up the compiler.

*** ./gdk_imlib/io-ppm.c.old	2002-11-28 18:47:55.000000000 +0000
--- ./gdk_imlib/io-ppm.c	2002-11-28 18:48:57.000000000 +0000
***************
*** 176,183 ****
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = ((atoi(s)) * 255) / scale;
! 			      ptr[a++] = ptr[a - 1];
! 			      ptr[a++] = ptr[a - 1];
  			    }
  			  i = 0;
  			}
--- 176,185 ----
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = ((atoi(s)) * 255) / scale;
! 			      ptr[a] = ptr[a - 1];
! 				a++;
! 			      ptr[a] = ptr[a - 1];
! 				a++;
  			    }
  			  i = 0;
  			}
***************
*** 194,201 ****
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = atoi(s);
! 			      ptr[a++] = ptr[a - 1];
! 			      ptr[a++] = ptr[a - 1];
  			    }
  			  i = 0;
  			}
--- 196,205 ----
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = atoi(s);
! 			      ptr[a] = ptr[a - 1];
! 			      a++;
! 			      ptr[a] = ptr[a - 1];
! 			      a++;
  			    }
  			  i = 0;
  			}
*** ./Imlib/load.c.old	2002-11-28 18:49:47.000000000 +0000
--- ./Imlib/load.c	2002-11-28 18:50:19.000000000 +0000
***************
*** 1464,1471 ****
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = ((atoi(s)) * 255) / scale;
! 			      ptr[a++] = ptr[a - 1];
! 			      ptr[a++] = ptr[a - 1];
  			    }
  			  i = 0;
  			}
--- 1464,1473 ----
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = ((atoi(s)) * 255) / scale;
! 			      ptr[a] = ptr[a - 1];
! 				a++;
! 			      ptr[a] = ptr[a - 1];
! 				a++;
  			    }
  			  i = 0;
  			}
***************
*** 1482,1489 ****
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = atoi(s);
! 			      ptr[a++] = ptr[a - 1];
! 			      ptr[a++] = ptr[a - 1];
  			    }
  			  i = 0;
  			}
--- 1484,1493 ----
  			  if ((i > 1) && (isdigit(s[i - 2])))
  			    {
  			      ptr[a++] = atoi(s);
! 			      ptr[a] = ptr[a - 1];
! 				++a;
! 			      ptr[a] = ptr[a - 1];
! 				++a;
  			    }
  			  i = 0;
  			}


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
    
Actual results:


Expected results:


Additional info:
Comment 1 Jonathan Blandford 2003-02-08 00:39:48 EST
Filed upstream as http://bugzilla.gnome.org/show_bug.cgi?id=105558
Maintainer said he'd get to it in a later release.

Note You need to log in before you can comment on or make changes to this bug.