Bug 136822

Summary: libwmf-0.2.8.2-95: undefined C code
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Vladimir Nadvornik <nadvornik>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.0   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-12-03 12:51:35 UTC
I just tried to compile package libwmf-0.2.8.2-95 with a prerelease of the
GNU C compiler version 4.1. It said

1.

gd_gd2.c:641: warning: operation on `chunkPos' may be undefined

The source code is

                          ch = chunkBuf[chunkPos++] << 24 +
                            chunkBuf[chunkPos++] << 16 +
                            chunkBuf[chunkPos++] << 8 +
                            chunkBuf[chunkPos++];

I agree with the compiler - this code seems to be undefined.

Suggest code rework. Maybe 

                          ch = chunkBuf[chunkPos] << 24 +
                            chunkBuf[chunkPos + 1] << 16 +
                            chunkBuf[chunkPos + 2] << 8 +
                            chunkBuf[chunkPos + 3];
                          chunkPos += 4;

might be ok.
Comment 1 David Binderman 2005-12-03 12:53:07 UTC
I forgot to mention that the email address of the author is broken
[ Caolan.McNamara@ul.ie ]
Comment 2 Vladimir Nadvornik 2006-01-26 18:08:48 UTC
fixed for 10.1 beta3, including email of the author.