zsh-users
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Jens Petersen <petersen@redhat.com>
Cc: Zsh users list <zsh-users@sunsite.dk>, d.binderman@virgin.net
Subject: Re: zle_thingy.c: variable "modsave" used before its value set
Date: Mon, 12 Apr 2004 02:04:36 -0700	[thread overview]
Message-ID: <20040412090436.GC28460@blorf.net> (raw)
In-Reply-To: <m34qrqgemf.wl%petersen@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On Mon, Apr 12, 2004 at 10:38:00AM +0900, Jens Petersen wrote:
> I received a bug report that the local variable `modsave' is
> used uninitialised in bin_zle_call() (zle_thingy.c).

The variable can't actually be used uninitialized -- the compiler just
thinks it can.

If we want to get rid of the warning, I'd recommend making the struct
static rather than initializing it to an unneeded value on every call.
Here's a patch that does this, plus it gets rid of some unneeded cleanup
code that can't get triggered.

..wayne..

[-- Attachment #2: modsave.patch --]
[-- Type: text/plain, Size: 496 bytes --]

--- Src/Zle/zle_thingy.c	12 Dec 2003 22:53:28 -0000	1.12
+++ Src/Zle/zle_thingy.c	12 Apr 2004 08:40:04 -0000
@@ -622,13 +622,11 @@ static int
 bin_zle_call(char *name, char **args, Options ops, char func)
 {
     Thingy t;
-    struct modifier modsave;
+    static struct modifier modsave;
     int ret, saveflag = 0;
     char *wname = *args++;
 
     if (!wname) {
-	if (saveflag)
-	    zmod = modsave;
 	return (!zleactive || incompctlfunc || incompfunc ||
 		sfcontext != SFC_WIDGET);
     }

  reply	other threads:[~2004-04-12  9:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-12 17:23 4.2.0-pre-4 Peter Stephenson
2004-03-12 18:58 ` 4.2.0-pre-4 Peter Stephenson
2004-03-15 11:30   ` 4.2.0-pre-4 Ibraheem Umaru-Mohammed
2004-03-15 16:20     ` 4.2.0-pre-4 Peter Stephenson
2004-04-12  1:38 ` zle_thingy.c: variable "modsave" used before its value set Jens Petersen
2004-04-12  9:04   ` Wayne Davison [this message]
2004-04-12 15:21     ` Bart Schaefer
2004-04-12 16:22       ` Wayne Davison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040412090436.GC28460@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=d.binderman@virgin.net \
    --cc=petersen@redhat.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).