Bug 146001

Summary: bad patch and dead code
Product: [Fedora] Fedora Reporter: David Binderman <dcb314>
Component: pilot-linkAssignee: Than Ngo <than>
Status: CLOSED RAWHIDE 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-01-24 18:07:05 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-01-24 17:31:12 UTC
Description of problem:

I just tried to compile package pilot-link-0.11.8-9 from 
Redhat Fedora development tree.

The compiler said

1.

pi-file.c(1326): remark #592: variable "flags" is used before its
value is set

The source code is

         /* Judd - 25Nov99 - Graffiti hack We want to make sure that
these 2
            flags get set for this one */

        if (pf->info.creator == pi_mktag('g', 'r', 'a', 'f')) {
                flags |= dlpDBFlagNewer;
                flags |= dlpDBFlagReset;
        }

        /* Set up DB flags */
        flags = pf->info.flags;

Crazy code. Why |= into local variable flags and then immediately after
set up flags from something else ?

Patch from 25Nov99 looks badly placed. Suggest 

        /* Set up DB flags */
        flags = pf->info.flags;

         /* Judd - 25Nov99 - Graffiti hack We want to make sure that
these 2
            flags get set for this one */

        if (pf->info.creator == pi_mktag('g', 'r', 'a', 'f')) {
                flags |= dlpDBFlagNewer;
                flags |= dlpDBFlagReset;
        }

might be better code.

2.

address.cc(17): remark #177: function "pair" was declared but never
referenced

I've had a look at the source code, and I agree with the compiler.
Suggest delete dead code.


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


How reproducible:


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


Expected results:


Additional info:

Comment 1 Than Ngo 2005-01-24 18:07:05 UTC
it's now fixed in 0.11.8-10. Thanks for your report.