Bug 116661 - local variable used before set + printf problem
Summary: local variable used before set + printf problem
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: XFree86
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-24 09:07 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-12 17:16:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2004-02-24 09:07:54 UTC
Description of problem:

I just tried to compile Core2 Test1 package XFree86-4.3.0-45.0.1

The compiler said

1.

Actions.c(650): warning #268: the format string ends before this argument

The source code is

  size = XmuSnprintf(msg, sizeof(msg), "%s(): bad number of
parameters.\n\t(",
                     action_name, action_name);

One % specifier, two trailing parameters. I'm not sure what the fix is
for this.

2.

r200_pixel.c(183): remark #592: variable "size" is used before its
value is set

The source code is

   if (!check_color(ctx, type, format, pack, pixels, size, pitch))

Suggest init size before first use.


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


How reproducible:


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


Expected results:


Additional info:

Comment 1 Mike A. Harris 2004-03-13 02:06:25 UTC
Filed against Fedora Core 2, but Fedora Core 2 isn't released yet.
I'm assuming this was Fedora Core 2 test release number 1.  Changing
version.

Comment 2 Mike A. Harris 2004-03-24 22:26:49 UTC
Problem 1 above seems to not be present in Xorg-X11 in rawhide
currently.  I checked both the Xaw and Xaw6 directories.

Comment 3 Mike A. Harris 2004-03-26 07:38:17 UTC
Problem 1 above, fixed in XFree86-4.3.0 in our internal CVS.

Comment 4 Mike A. Harris 2004-03-26 08:49:20 UTC
check_color( const GLcontext *ctx, GLenum type, GLenum format,
             const struct gl_pixelstore_attrib *packing,
             const void *pixels, GLint sz, GLint pitch )


The "sz" variable is not even used inside check_color() in
r200_pixel.c in 4.3.0.  It's possible that the code was used
for something at one point, and then removed, with a few
things left behind.

I'm fixing the bug in 4.3.0 anyway, even though it is totally
harmless, but also removing this from being a Fedora Core 2
target bug, as it only affects XFree86 4.3.0, and we've switched
to Xorg X11.

Comment 5 Mike A. Harris 2004-03-26 09:25:49 UTC
Ok, fixed the r200 issue in both XFree86 4.3.0 in internal CVS,
and also xorg-x11 in CVS, so both fixes will be in all future
builds where relevant.  Also emailed dri-devel to inquire about
the r200 issue since the code there seems bogus.

Will possibly update the r200 fixes based on DRI developer feedback.

Comment 6 Mike A. Harris 2004-03-30 08:03:17 UTC
Fixes merged in our internal CVS as per above, however after discussing
this with DRI developers, we've decided to remove the unused variables
in a future build, as they're not used anywhere in the sources.

Reopening to track, until I get it merged into DRI-CVS and xorg CVS.


Comment 7 Mike A. Harris 2004-10-12 17:16:35 UTC
This is in current X.Org for quite a while now...

closing as CURRENTRELEASE.


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