From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43415-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIMWL_WL_MED autolearn=ham autolearn_force=no version=3.4.1 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id d79140b7 for ; Fri, 7 Sep 2018 23:51:35 +0000 (UTC) Received: (qmail 19327 invoked by alias); 7 Sep 2018 23:51:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43415 Received: (qmail 12576 invoked by uid 1010); 7 Sep 2018 23:51:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f44.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.167.44):SA:0(-1.9/5.0):. Processed in 1.287914 secs); 07 Sep 2018 23:51:24 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Oh78VGr5VNBgjmwu20X4N228NY0TZFIKtJ0TIw5E2oY=; b=UhBYkFeXz11IzUYcYCHt+Zm56UmieuJFq689P/zvtmk2DIaqa45pK1eV8m0HZlqF+5 XtCr81iPqgMAuDzypO4hXueKSFkm0MAG76fR6E1YtUiyGl4/tD6beQqS0zkVQnJQALbl Flcz1m4qWhN7jN0Pz5fbjUoYNY9tX2DJ+8om4uVze9JmkxhIbryrviXhfnnfc79HBZ7H FIgONO0eB3fZ1ZcCpKdzdKjQQrB2Wjkw7kK2RQ96K34am3+zKLW9t1mPZ8a0Fii2hOLS D5f/3vd+NAm8LE4tziRdbCWdL1wdpe/3vL+7+fof7D+enbbxRHTluOmtjX3DAJGFzLhW YncA== X-Gm-Message-State: APzg51DJmiygxabK1bvx/6eoEo7X8+/f0gxuKFUNEWlaodu/0PeLOz1a ZFQ5FF8JlTVc+zFtBqzjABHLEt6Hr+kFm2GX5c+HSw== X-Google-Smtp-Source: ANB0VdbJlZpw8/nLiNIcaQIJTyvfQ3rowWAr9WX2TrgMlj8ZK5xIDT7L+vp81AuPLyQPIohzg8dc7aY0fW/2YnSovkQ= X-Received: by 2002:a19:ef18:: with SMTP id n24-v6mr6659115lfh.36.1536364279436; Fri, 07 Sep 2018 16:51:19 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <42391-1536362558.149296@9SUZ.DmAr.oCmA> References: <42391-1536362558.149296@9SUZ.DmAr.oCmA> From: Bart Schaefer Date: Fri, 7 Sep 2018 16:51:18 -0700 Message-ID: Subject: Re: Used-uninitalized error I hadn't seen before To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Fri, Sep 7, 2018 at 4:22 PM, Oliver Kiddle 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.