Bug 116561 - local variable used before set
local variable used before set
Product: Fedora
Classification: Fedora
Component: zsh (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2004-02-23 04:15 EST by d.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:
Last Closed: 2004-07-05 03:37:05 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description d.binderman 2004-02-23 04:15:42 EST
Description of problem:

I just tried to compile Core2 Test1 package zsh-4.0.9-1

The compiler said

zle_thingy.c(607): remark #592: variable "modsave" is used before its
value is set

The source code is

    struct modifier modsave;
    int ret, saveflag = 0;
    char *wname = *args++;

    if (!wname) {
        if (saveflag)
            zmod = modsave;

Suggest init local variable modsave before first use.

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

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Jens Petersen 2004-04-09 11:58:10 EDT
I think it is worth reporting this problem to upstream
if it is still present in cvs.
Comment 2 Jens Petersen 2004-04-09 12:01:01 EDT
Not sure what it should be initialised to though?
Comment 3 Jens Petersen 2004-04-09 12:01:29 EDT
Still present in 4.2.0 btw.
Comment 5 Alan Cox 2004-06-16 12:01:59 EDT
Doesn't appear to matter - the code path is never taken

On entry  saveflag is always zero.

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