From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 09 17:18:40 2021 Received: (at submit) by debbugs.gnu.org; 9 Mar 2021 22:18:40 +0000 Received: from localhost ([127.0.0.1]:48186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJkgL-00016t-P5 for submit@debbugs.gnu.org; Tue, 09 Mar 2021 17:18:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:34386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJkgH-00016k-TM for submit@debbugs.gnu.org; Tue, 09 Mar 2021 17:18:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJkgH-0005BI-No for bug-guile@gnu.org; Tue, 09 Mar 2021 17:18:21 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48355) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJkgH-0000Rj-H3 for bug-guile@gnu.org; Tue, 09 Mar 2021 17:18:21 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47868 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lJkgH-0007m6-2o for bug-guile@gnu.org; Tue, 09 Mar 2021 17:18:21 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guile@gnu.org Subject: False positives for =?utf-8?Q?=E2=80=98-Wunbound-variable?= =?utf-8?Q?=E2=80=99?= in 3.0.5 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 =?utf-8?Q?Vent=C3=B4se?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 09 Mar 2021 23:18:19 +0100 Message-ID: <87im606kes.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The new =E2=80=98unbound-variable=E2=80=99 warning in 3.0.5 has false posit= ives, as in this example: --8<---------------cut here---------------start------------->8--- $ cat /tmp/unbound.scm (use-modules (srfi srfi-35)) (condition (&message (message "oh no!")) (&serious)) $ guild compile -Wunbound-variable /tmp/unbound.scm /tmp/unbound.scm:3:0: warning: possibly unbound variable `make-compound-con= dition' wrote `/home/ludo/.cache/guile/ccache/3.0-LE-8-4.4/tmp/unbound.scm.go' $ guild --version guild (GNU Guile) 3.0.5 Copyright (C) 2021 Free Software Foundation, Inc. License LGPLv3+: GNU LGPL 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. --8<---------------cut here---------------end--------------->8--- 3.0.4 and earlier versions are fine. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 16:34:42 2021 Received: (at 47031) by debbugs.gnu.org; 1 May 2021 20:34:42 +0000 Received: from localhost ([127.0.0.1]:38268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcwK1-0005Kb-Th for submit@debbugs.gnu.org; Sat, 01 May 2021 16:34:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcwK0-0005KV-JI for 47031@debbugs.gnu.org; Sat, 01 May 2021 16:34:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49607) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcwJv-0002NN-De for 47031@debbugs.gnu.org; Sat, 01 May 2021 16:34:35 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=45180 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lcwJu-0007ZR-6Z for 47031@debbugs.gnu.org; Sat, 01 May 2021 16:34:34 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 47031@debbugs.gnu.org Subject: Re: bug#47031: False positives for =?utf-8?Q?=E2=80=98-Wunbound-v?= =?utf-8?Q?ariable=E2=80=99?= in 3.0.5 References: <87im606kes.fsf@inria.fr> Date: Sat, 01 May 2021 22:34:32 +0200 In-Reply-To: <87im606kes.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Tue, 09 Mar 2021 23:18:19 +0100") Message-ID: <878s4y6vmv.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 47031 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello! Ludovic Court=C3=A8s skribis: > $ cat /tmp/unbound.scm > (use-modules (srfi srfi-35)) > > (condition (&message (message "oh no!")) > (&serious)) > $ guild compile -Wunbound-variable /tmp/unbound.scm > /tmp/unbound.scm:3:0: warning: possibly unbound variable `make-compound-c= ondition' The problem was that =E2=80=98make-compound-condition=E2=80=99 is re-export= ed from (srfi srfi-35) and this particular case was not handled. The attached patch fixes it. Let me know what you think! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/module/language/tree-il/analyze.scm b/module/language/tree-il/analyze.scm index 766568f38..4b53e426f 100644 --- a/module/language/tree-il/analyze.scm +++ b/module/language/tree-il/analyze.scm @@ -510,6 +510,11 @@ given `tree-il' element." ;; The variable is an import. At the time of use, the ;; name is bound to the import. 'import) + ((and=> (module-public-interface mod) + (lambda (interface) + (module-variable interface name))) + ;; The variable is re-exported from module. + 'import) (else ;; Variable unbound in the module. 'unbound)))))) diff --git a/test-suite/tests/tree-il.test b/test-suite/tests/tree-il.test index 217a1000f..262c2454d 100644 --- a/test-suite/tests/tree-il.test +++ b/test-suite/tests/tree-il.test @@ -557,6 +557,19 @@ #:env m #:opts %opts-w-unbound)))))))) + (pass-if "macro-inserted binding" + (null? (call-with-warnings + (lambda () + (compile '(begin + (use-modules (srfi srfi-35)) + + ;; This 'condition' form expands to a + ;; 'make-compound-condition' call, which is + ;; re-exported from (ice-9 exceptions). + (condition (&error) + (&message (message "oh!")))) + #:opts %opts-w-unbound))))) + (with-test-prefix "use-before-definition" (define-syntax-rule (pass-if-warnings expr pat test) (pass-if 'expr --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 01 19:26:52 2021 Received: (at 47031-done) by debbugs.gnu.org; 1 May 2021 23:26:52 +0000 Received: from localhost ([127.0.0.1]:39005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcz0d-0006yf-Sq for submit@debbugs.gnu.org; Sat, 01 May 2021 19:26:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lcz0c-0006yV-P7 for 47031-done@debbugs.gnu.org; Sat, 01 May 2021 19:26:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51037) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lcz0X-0003vI-Hq for 47031-done@debbugs.gnu.org; Sat, 01 May 2021 19:26:45 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=46124 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lcz0W-0002h6-S3 for 47031-done@debbugs.gnu.org; Sat, 01 May 2021 19:26:45 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 47031-done@debbugs.gnu.org Subject: Re: bug#47031: False positives for =?utf-8?Q?=E2=80=98-Wunbound-v?= =?utf-8?Q?ariable=E2=80=99?= in 3.0.5 References: <87im606kes.fsf@inria.fr> <878s4y6vmv.fsf@gnu.org> Date: Sun, 02 May 2021 01:26:43 +0200 In-Reply-To: <878s4y6vmv.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 01 May 2021 22:34:32 +0200") Message-ID: <87sg36593g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 47031-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ludovic Court=C3=A8s skribis: > The problem was that =E2=80=98make-compound-condition=E2=80=99 is re-expo= rted from (srfi > srfi-35) and this particular case was not handled. > > The attached patch fixes it. Let me know what you think! Pushed as 5969490f55e5a167a3eb2573a3c5241c0ce079f3 following the IRC=E2=80=99d LGTM. :-) Ludo=E2=80=99. From unknown Wed Sep 10 19:32:13 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 30 May 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator