Bug 116561

Summary: local variable used before set
Product: [Fedora] Fedora Reporter: d.binderman
Component: zshAssignee: Jens Petersen <petersen>
Status: CLOSED UPSTREAM QA Contact: Mike McLean <mikem>
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: 2004-07-05 07:37: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 d.binderman 2004-02-23 09:15:42 UTC
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:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jens Petersen 2004-04-09 15:58:10 UTC
I think it is worth reporting this problem to upstream
if it is still present in cvs.

Comment 2 Jens Petersen 2004-04-09 16:01:01 UTC
Not sure what it should be initialised to though?

Comment 3 Jens Petersen 2004-04-09 16:01:29 UTC
Still present in 4.2.0 btw.

Comment 5 Alan Cox 2004-06-16 16:01:59 UTC
Doesn't appear to matter - the code path is never taken

On entry  saveflag is always zero.