Bug 80670 - bad source code
bad source code
Status: CLOSED UPSTREAM
Product: Red Hat Linux
Classification: Retired
Component: gimp (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nils Philippsen
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-29 12:21 EST by d.binderman
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-21 12:21:20 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-29 12:21:33 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I have just tried to compile package gimp-1.2.3-9 from Redhat 8.0

I got the following message from the compiler.

cc: Warning: imap_preview.c, line 167: In the initializer for avg, the expression "(299**colour+++587**colour+++114**colour++)/1000" modifies the 
variable "colour" more than once without an intervening sequence point.  This behavior is undefined. (undefvarmod)

Here is an untested patch to shut up the compiler.

./plug-ins/imagemap/imap_preview.c.old ./plug-ins/imagemap/imap_preview.c
*** ./plug-ins/imagemap/imap_preview.c.old	Sun Dec 15 09:25:53 2002
--- ./plug-ins/imagemap/imap_preview.c	Sun Dec 15 09:26:34 2002
***************
*** 164,171 ****
  	 colour = cmap + 3 * (int)(*src);
  
  	 if (gray) {
! 	    guchar avg = (299 * *colour++ + 587 * *colour++ +
! 			  114 * *colour++) / 1000;
  	    *dest++ = avg;
  	    *dest++ = avg;
  	    *dest++ = avg;
--- 164,172 ----
  	 colour = cmap + 3 * (int)(*src);
  
  	 if (gray) {
! 	    guchar avg = (299 * colour[ 0] + 587 * colour[ 1] +
! 			  114 * colour[ 2]) / 1000;
! 	    colour += 3;
  	    *dest++ = avg;
  	    *dest++ = avg;
  	    *dest++ = avg;


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


How reproducible:
Always

Steps to Reproduce:
1. compile with Compaq compiler
2.
3.
    

Additional info:


compaq compiler is not significant. GNU Compiler could 
probably also produce this error message with -Wall.
Comment 1 Nils Philippsen 2004-02-21 12:15:44 EST
This is stuff for upstream really. 8.0 is end-of-life also.
Comment 2 Nils Philippsen 2004-02-21 12:20:27 EST
Re-assign so replies reach me.
Comment 3 Nils Philippsen 2004-02-21 12:20:49 EST
Re-assign so replies reach me.

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