Bug 146001 - bad patch and dead code
bad patch and dead code
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pilot-link (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-24 12:31 EST by David Binderman
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-24 13:07:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Binderman 2005-01-24 12:31:12 EST
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 Ngo Than 2005-01-24 13:07:05 EST
it's now fixed in 0.11.8-10. Thanks for your report.

Note You need to log in before you can comment on or make changes to this bug.