Bug 146757 - local variable used before set
local variable used before set
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gtkhtml3 (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Dave Malcolm
:
Depends On:
Blocks: FC5Target
  Show dependency treegraph
 
Reported: 2005-02-01 07:05 EST by David Binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-18 16:10:58 EDT
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 David Binderman 2005-02-01 07:05:29 EST
Description of problem:

I just tried to compile package gtkhtml3-3.5.4-1 from 
Redhat Fedora development tree.

The compiler said

htmltextslave.c(184): remark #592: variable "gi" is used before its
value is set

The source code is

                HTMLTextSlaveGlyphItem *gi = (HTMLTextSlaveGlyphItem
*) gi;

                if (gi->type == HTML_TEXT_SLAVE_GLYPH_ITEM_CREATED) {

Bizzare code. gi gets initialised with it's own (undefined) value,
and then it gets used as a valid pointer in the if statement.

Suggest code re-work. Has this code ever been tested ?


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


How reproducible:


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


Expected results:


Additional info:
Comment 1 Dave Malcolm 2005-08-17 23:50:07 EDT
Thanks for this report.

I agree that this code is bizarre, and will work on getting it fixed upstream.
Comment 2 Dave Malcolm 2005-08-18 16:10:58 EDT
It's been fixed in upstream CVS:
http://cvs.gnome.org/viewcvs/gtkhtml/src/htmltextslave.c?r1=1.188.2.3&r2=1.188.2.4

Bug was fixed by gtkhtml-3.7.5, so fixed it's fixed in rawhide.
Bug exists from gtkhtml-3.5.3 to gtkhtml-3.6.2, so potentially affects FC4, but
does not affect FC3.

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