Bug 106314

Summary: bad source code
Product: [Retired] Red Hat Linux Reporter: d.binderman
Component: xsaneAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.91-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-12-05 12:41:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description d.binderman 2003-10-05 09:48:53 UTC
Description of problem:

Hello there,

I just tried to compile package xsane-0.89-3, from Redhat 9.0,
with compiler flag -Wall.

The compiler said

xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined
xsane-preview.c:5690: warning: operation on `image_data_rawp' may be undefined

The source code is

	level = ((*image_data_rawp++) + (*image_data_rawp++) + (*image_data_rawp++)) / 3;

Better source code is

	level = ((*image_data_rawp) + (image_data_rawp[ 1]) + (image_data_rawp[ 2])) / 3;
	image_data_rawp += 3;



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


How reproducible:


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


Expected results:


Additional info:

Comment 1 Tim Waugh 2003-10-08 09:25:57 UTC
Fixed in CVS.  Thanks.

Comment 2 Tim Waugh 2003-12-05 12:41:04 UTC
*** Bug 111532 has been marked as a duplicate of this bug. ***