Bug 110809 - bad source code
bad source code
Status: CLOSED DUPLICATE of bug 101037
Product: Fedora
Classification: Fedora
Component: gthumb (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Christopher Aillon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-11-24 11:36 EST by d.binderman
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 14:00:09 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 2003-11-24 11:36:45 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)

Description of problem:

I just tried to compile package gthumb-2_0_2-1 from Fedora 

The compiler said

1.

preferences.c:351: warning: operation on `i' may be undefined
preferences.c:352: warning: operation on `i' may be undefined
preferences.c:353: warning: operation on `i' may be undefined

The source code is

        *r = dec (hex[i++]) * 16 + dec (hex[i++]);
        *g = dec (hex[i++]) * 16 + dec (hex[i++]);
        *b = dec (hex[i++]) * 16 + dec (hex[i++]);

Clearly wrong. Better source code is

        *r = dec (hex[ i]) * 16 + dec (hex[ i + 1]);
        *g = dec (hex[ i + 2]) * 16 + dec (hex[ i + 3]);
        *b = dec (hex[ i + 4]) * 16 + dec (hex[ i + 5]);

2.

preferences.c:397: warning: operation on `i' may be undefined
preferences.c:398: warning: operation on `i' may be undefined
preferences.c:399: warning: operation on `i' may be undefined

Same problem as above. 


Version-Release number of selected component (if applicable):
gthumb-2_0_2-1 

How reproducible:
Always

Steps to Reproduce:
1. compile the program with compiler flag -Wall.
2.
3.
    

Additional info:
Comment 1 Havoc Pennington 2003-11-24 17:16:53 EST
Compiler warnings like this should really be filed with the upstream
developers (in this case bugzilla.gnome.org) since they need to be
fixed in the master copy of the source code, not in Red Hat patches.
Comment 2 d.binderman 2003-11-25 07:15:41 EST
>Compiler warnings like this should really be filed with the upstream
>developers (in this case bugzilla.gnome.org)

I tried the website you suggsted, and couldn't get access it.

Could I ask you to submit this bug for me, please ?
Comment 3 d.binderman 2003-11-25 07:16:24 EST
>Compiler warnings like this should really be filed with the upstream
>developers (in this case bugzilla.gnome.org)

I tried the website you suggsted, and couldn't get access it.

Could I ask you to submit this bug for me, please ?
Comment 4 Christopher Aillon 2004-08-26 01:50:40 EDT

*** This bug has been marked as a duplicate of 101037 ***
Comment 5 Red Hat Bugzilla 2006-02-21 14:00:09 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

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