Bug 111280

Summary: undefined source code & used before set
Product: [Fedora] Fedora Reporter: d.binderman
Component: timidity++Assignee: Thomas Woerner <twoerner>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
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: 2006-02-21 19:00:14 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-12-01 18:29:21 UTC
Description of problem:
I just tried to compile package timidity++-2.11.3-8 from Fedora.

The compiler said

1.

resample.c:990: warning: operation on `dest' may be undefined
resample.c:991: warning: operation on `dest' may be undefined

The source code is

  *dest++ = *(dest - 1) / 2;
  *dest++ = *(dest - 1) / 2;

This source code is undefined. Better source code is

  *dest = *(dest - 1) / 2;
  ++dest;
  *dest = *(dest - 1) / 2;
  ++dest;

2.

playmidi.c(4667): remark #592: variable "rc" is used before its value
is set

The source code is

    int rc;
    static int play_count = 0;

    if (play_mode->id_character == 'm') {
        int cnt;

        convert_mod_to_midi_file(eventlist);

        play_count = 0;
        cnt = free_global_mblock();     /* free unused memory */
        if(cnt > 0)
            ctl->cmsg(CMSG_INFO, VERB_VERBOSE,
                      "%d memory blocks are free", cnt);
        return rc;
    }

Suggest initialise rc before first use.



Version-Release number of selected component (if applicable):
timidity++-2.11.3-8 

How reproducible:


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


Expected results:


Additional info:

Comment 1 Thomas Woerner 2004-04-22 13:28:55 UTC

*** This bug has been marked as a duplicate of 106308 ***

Comment 2 Red Hat Bugzilla 2006-02-21 19:00:14 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.