Bug 110809 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED DUPLICATE of bug 101037
Alias: None
Product: Fedora
Classification: Fedora
Component: gthumb
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Christopher Aillon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-24 16:36 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-21 19:00:09 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2003-11-24 16:36:45 UTC
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 22:16:53 UTC
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 12:15:41 UTC
>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 12:16:24 UTC
>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 05:50:40 UTC

*** This bug has been marked as a duplicate of 101037 ***

Comment 5 Red Hat Bugzilla 2006-02-21 19:00:09 UTC
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.