Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Used-uninitalized error I hadn't seen before
- X-seq: zsh-workers 43415
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- Subject: Re: Used-uninitalized error I hadn't seen before
- Date: Fri, 7 Sep 2018 16:51:18 -0700
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Oh78VGr5VNBgjmwu20X4N228NY0TZFIKtJ0TIw5E2oY=; b=cChqETQ0gukfpNVnYUWe1iK7tBCGBTCfRCdfVSFGjWRO8i+/I2XwjaQ8O6hBax0kDW DbtsIfRoTkRPkS4GFgZguDCejS3rsXLPbYt4sDOsltbdkCc+YnpULYFjFXUIxZlTougy hcGAlMXVUdD6CrqC/bVimXzRCtUuxUSkEU/oz+tKHFQgti+qhEL5WQzPSUOPXIrvoPcv sWyOxV9+n+2/eVlmUwPV6jBLpkfPHlw8t/v4AI45zjXgy2fiGipBVL7yQXaS/7aV+0fJ bDHGC73381J5UAVoDd2En0wFdPLk+EvfY8sQ+Lf7T13SAweW4k9baLk7rgxTs6dxX86g qX/w==
- In-reply-to: <42391-1536362558.149296@9SUZ.DmAr.oCmA>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAH+w=7YxE5RxUHufvpTWdFP3imLgkuSSNK7erei3xrhcEeYhOQ@mail.gmail.com> <42391-1536362558.149296@9SUZ.DmAr.oCmA>
On Fri, Sep 7, 2018 at 4:22 PM, Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>
> What compiler is this and what options? I don't get the warning with any
> compiler I've got. It'd be useful to track down which uses of the
> variable cause the warning.
This is on what I have to assume (I'm not the admin) is a stock CentOS 6.9 host:
gcc -c -I. -I../../Src -I../../Src -I../../Src/Zle -I.
-DHAVE_CONFIG_H -DMODULE -Wall -Wmissing-prototypes -O2 -fPIC -o
computil..o computil.c
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
> I'm fairly sure that it is wrong and grplen can't be used uninitialized.
So we have this:
1847 if (sep > x) { /* exclusion included a set or group name */
1848 grp = x;
1849 grplen = sep - grp;
1850 x = sep;
1851 }
and then later uses of grplen are protected by expressions like
1853 if (excludeall || (x[0] == ':' && !x[1])) {
1854 if (grp) {
e.g., at line 1858 grplen is passed to strncmp() and at line 1859 is
used in a subscript. It's not obvious to me why the conditions on
1853-1854 are a superset of 1847.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author