Bug 162376

Summary: undefined code + reading from uninited var
Product: [Fedora] Fedora Reporter: David Binderman <dcb314>
Component: openoffice.orgAssignee: Caolan McNamara <caolanm>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-04 07:56:34 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 David Binderman 2005-07-03 12:17:33 UTC
Description of problem:

I just tried to compile package openoffice.org-1.9.104-2 from Redhat
Fedora Core development tree with the gcc 4.0.0 compiler and the
compiler flag -Wall.

The compiler said

1.

thread.c:631: warning: operation on ââ¬Ëiââ¬â¢ may be undefined

The source code is

	for (n = 0, i = HASHID(hThread); n < HashSize; n++, i = ++i % HashSize)

I agree with the compiler. Perhaps better code would be

	for (n = 0, i = HASHID(hThread); n < HashSize; n++, i = (i + 1) % HashSize)

2.

soundlib.c:919: warning: ââ¬Ëdââ¬â¢ is used uninitialized in this function

The source code is

    if (!d || !(ba = AuGetBucketAttributes(aud, bucket, ret_status)))
        return NULL;

Suggest initialise "d" 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 Caolan McNamara 2005-07-04 07:56:34 UTC
2 is in nas, which is only built to get it's headers for use elsewhere, so the
code from nas is not actually used. So we'll ignore it.

1 looks nasty, logged as http://www.openoffice.org/issues/show_bug.cgi?id=51521