From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 39e533d0 for ; Wed, 9 Oct 2019 12:09:05 +0000 (UTC) Received: (qmail 15644 invoked by alias); 9 Oct 2019 12:08:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24331 Received: (qmail 14183 invoked by uid 1010); 9 Oct 2019 12:08:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f53.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25594. spamassassin: 3.4.2. Clear:RC:0(209.85.166.53):SA:0(-2.0/5.0):. Processed in 3.69462 secs); 09 Oct 2019 12:08:59 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.53 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8S4uAvd/2p62NCHzYcRO2HSA+b594039zYMspO+TjVU=; b=Lci64KdQHlMv9AOJ76ObIyjhOlvNQ8a+LYaUbwKKKvoCxauRxQzBx/6b6lqvE776S/ St9u03GVLKgJ595/e7GauIusEQ532ndjx/LpEc1co85qoQzQ8WoYJKvE/HZHzsK57BQR FN44p8Ki6V7Lnj8zwkYRtU6b4hKJgYrnTLqfuBbWiol9GeJarEpvZ+MuZc7BQ40JjaNc OQnv4+jqyCcYXuBnd3pDPWFTSjwH4C4nYpfvYb4oD07bGaB82yHoKtTe13Qh28xMYMKZ kW8Dxbjz8ckoOuy2wCwMHzWtQUp9eztG46poVjtxpU6gMEFOSew4zCsjns08UR0PGU7o dnWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8S4uAvd/2p62NCHzYcRO2HSA+b594039zYMspO+TjVU=; b=NQ/mhZ+F3eu+Z0Zanx5D9r64MRmkLfPSEFJUVvN5SmyWtObUndrapVlH4e36NcTHLy wAXs3DWa6v4GJr3SAXpcKGrVuBNJHVm+fd4Ci9eiW40pAZuPO/iWLHUd1GfBRiofFLbG 9t7ARz/b2CkMHqsBLD6db8uKztsupcSLIgyZTnmC9UspB7eNsWNyzWkm9gBpw6ylNpLv 4nRBU9VdqDPxLPshCsdM4aJqwkTuaSzj1p/xmFV2ck72tDvTAv6a++v3xH5fFGny9Vft 7FnSe1ORaQjyz2SAcMAejB1MbOX3rb2oFpKxyuTKUiWtlCUxBSq9TwIWxVZ5D50W3B5B 4pGA== X-Gm-Message-State: APjAAAU6I9Ygo2N6vkjDURq4/sm2WB1c3mNL5mQRtsdd5U6mfmVe1mNU HsneQc/otprxu4UbmXOSEtOuco6uJ0NNJJSE/xA6XWPQhPk= X-Google-Smtp-Source: APXvYqzoMbrFsyBktqgRcdEZLdxMP41hLxWr2QKk6Np8DAl1UHR8mSx1t0/tpjxX4DB7sLBeJlZ5zNPh9s54hikKakM= X-Received: by 2002:a05:6638:3a6:: with SMTP id z6mr2751724jap.33.1570622903265; Wed, 09 Oct 2019 05:08:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Wed, 9 Oct 2019 14:08:12 +0200 Message-ID: Subject: Re: Feature request: a new warning option To: Sebastian Gniazdowski Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" On Wed, Oct 9, 2019 at 1:56 PM Sebastian Gniazdowski wrote: > I would say: the code that is needy of using &&/|| in such a way can > skip this hypothetical new warning option. Covering 8 out of 10 > functions with it is still a good result (this reminds me the previous > discussion we've had). I'm not opposed to warnings that may have false positives. That's why they are warnings rather than errors. My point here is different. Imagine the documentation for the new warning: Warns if `x && y || z` cannot be proven through static analysis to be equivalent to `if x; then y; else z; fi`. Doesn't this strike you as odd? If the latter construct has the desired semantics, why not use it in the first place? It'll obviate the need for a new warning and convey the intention to humans reading the code. Roman.