From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#49749: 26.3; 26.3 & 27.2: invalid byte compiler warning in short-circuited or form Date: Sun, 01 Aug 2021 02:19:23 +0200 Message-ID: <87r1fe9fuc.fsf@web.de> References: <1B5C81C0-5D9A-4ED5-B56A-FC6AAA1A8A87@gmail.com> <8735rycvdr.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22066"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 49749@debbugs.gnu.org To: Pierre Rouleau Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 01 02:20:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9zD9-0005VZ-18 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Aug 2021 02:20:11 +0200 Original-Received: from localhost ([::1]:36120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m9zD7-0003YR-4A for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 31 Jul 2021 20:20:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m9zD0-0003YG-PB for bug-gnu-emacs@gnu.org; Sat, 31 Jul 2021 20:20:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51863) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m9zD0-0001uZ-HJ for bug-gnu-emacs@gnu.org; Sat, 31 Jul 2021 20:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m9zD0-00081Q-Dx for bug-gnu-emacs@gnu.org; Sat, 31 Jul 2021 20:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Aug 2021 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49749 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 49749-submit@debbugs.gnu.org id=B49749.162777717730799 (code B ref 49749); Sun, 01 Aug 2021 00:20:02 +0000 Original-Received: (at 49749) by debbugs.gnu.org; 1 Aug 2021 00:19:37 +0000 Original-Received: from localhost ([127.0.0.1]:35176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9zCb-00080h-DA for submit@debbugs.gnu.org; Sat, 31 Jul 2021 20:19:37 -0400 Original-Received: from mout.web.de ([212.227.17.11]:53777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m9zCW-00080P-4E for 49749@debbugs.gnu.org; Sat, 31 Jul 2021 20:19:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1627777165; bh=UA6on0qVbcQioOl9e27QszeuFzsQuaMnvz+Srtgw8NE=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=khD/iQlEYW1eO3o2+akgnXOUYbGIAEqku3iiyScqdDgq9gE5a5EgDofKBAmVGU34f TlFNsZPx7tEUBQifyXb+9ym4FcHyhu2M/IrfuVNG8r0xzEBHHpKSaHriAi3MwHyrPe LZ9qttHOvQ3O+plJ2poKTCdhQQn9NEgMxEKUR5+4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LvBIk-1n9tSY3roA-010PJ9; Sun, 01 Aug 2021 02:19:24 +0200 In-Reply-To: (Pierre Rouleau's message of "Sat, 31 Jul 2021 09:59:02 -0400") X-Provags-ID: V03:K1:9xZvNoeUsA/iqv0FtNyJ5bZqmfzJEoi1wz27UO+u0dOUZ7KRXLx Ej6U6eLu0Iu84VZTkzNnqxPUw31PEjp31aWU9kqzJ/uS62kBwtvrvC19V3iFkCCR5qLDYWA mlB+fKALxZIFxJdeA21++5K9tb5cqrKywYxpD/DpqaNNqUCf/jVs3EFgOYSRE9fQQB35qNY Xa8zhyzeunsNpT+iGLqoA== X-UI-Out-Filterresults: notjunk:1;V03:K0:3xtAiuM2qHA=:HCyvvHS9oFsTlsbL8iaMp4 cwlJ36oXNK93SoluJp09Pk/HN7mR1UDVXNvMZuYFgY633gkwNqizCtrji/73XlMX5fh6/n4KH sMrXrcyVPiw0uGS+h3wI7lI0O/Q+WF/r4f1PMNt4JSLJ0t1YGSRJEt1YwzsVN+C/mNtkiCBUr cPcag+sD4SNfbEuGDiK50UyFj1ZpzKYu//pf2V2PD3pT+7PWC+azzwO7ud1uf1V4ZZ0P/A7rB qr8V3yi1lTRm4l/dYRp3J2OCRnknFkQYWaBFj+ICdAIxpLfCL/ivX+JMgG4dd9a4LDgp1H3z7 EBArgP+Bny6YhEUxvxLWdea3ZCVoVUHKsOJXweMICC5jFgRRmj3owc0lGHH8Al4qK8VWmJ5gw s/Zf7JBmHZkw365GDCoJnWzQt/TBrxTGsgwMQmtIzBGoblz1RWWsg0c1xgkSwS1OE+5Ogwgfh KBmDJxlw3/P2ts4fFxPp0CX9WMU9xw914+NAzc8mHgmhtGndcsE9ocLtvC6aW+1bWcMjH6mbH Izl6n0b8PTAa1uKMVWpOIX3d2HGkMJAEdWEb1N8yPTeyeU+YUFuprBgdKozv+Y/sD4wMPBNjM hIKnuw81uPLzEXbdac5WBuN2IGWUwKLJFI6Ey0d03HobR1cYtrR9iFJclDzOLxxIHukrqsmTz 8YEaiLNN4hCn7JZydp9VNRQuCV9KndncS5YRWGw3Cgujsyk7AaJh0sgSwyKdNeJFv2YaJPKHq lcP6qE41rKA2am8KKhKyobj9YHVVpT0tWr8I8WypmMfh6Agh3U1M1fAacYnxjXSzF6fzxcfc X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211031 Archived-At: Pierre Rouleau writes: > On Wed, Jul 28, 2021 at 11:26 AM Lars Ingebrigtsen wrote: > > Pierre Rouleau writes: > > > (defun f-or () > > "Use or." > > (when (or (null (boundp 'foo)) > > (null foo)) ;=3D> ``Warning: reference to free variable = =E2=80=98foo=E2=80=99``=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20 > > (message "foo is not set"))) > Well, from the perspective of a user, that would look at the=20 > very least as a technical limitation. There are a lot of possible expressions of the form (some-expression-involving-both (boundp 'foo) foo) You have showed two. There is an unlimited number of such expressions, and it's impossible to solve the problem for all of them. It's not hard to support more, but for what gain? The warning is still correct - there _is_ a reference to a free variable. It doesn't say "unbound". When your reference to a free variable is not totally trivial, the common method is to add a (defvar foo) to your code. That tells you and other readers and the compiler that `foo' is a special variable defined elsewhere, and the warning is also gone. Also, (and (boundp 'foo) foo) is equivalent to (bound-and-true-p foo), so there is a canonical form for that kind of test that doesn't lead to a warning. For more complex real-life situations, you will probably need a `defvar' anyway, so we are really only discussing about rewritings of `bound-and-true-p' using De Morgan rules. I agree to Lars that this would not be a useful thing to do. Michael.