From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#39385: Erroneous interaction of eval-when-compile and condition-case Date: Sat, 1 Feb 2020 21:47:31 +0000 Message-ID: <20200201214731.GA11168@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="30370"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) To: 39385@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 01 22:48:19 2020 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 1iy0cl-0007n6-B7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Feb 2020 22:48:19 +0100 Original-Received: from localhost ([::1]:50982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iy0ck-0006BB-1k for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Feb 2020 16:48:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60685) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iy0cV-0006B5-Kk for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:48:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iy0cU-0005pH-MU for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:48:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iy0cU-0005oL-IO for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iy0cU-0001If-HI for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Feb 2020 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39385 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15805936594966 (code B ref -1); Sat, 01 Feb 2020 21:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Feb 2020 21:47:39 +0000 Original-Received: from localhost ([127.0.0.1]:39400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iy0c7-0001I2-GY for submit@debbugs.gnu.org; Sat, 01 Feb 2020 16:47:39 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iy0c6-0001Hv-4q for submit@debbugs.gnu.org; Sat, 01 Feb 2020 16:47:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iy0c4-00068X-RY for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:47:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iy0c3-0004uh-R0 for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:47:36 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:30190 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1iy0c3-0004r5-Gm for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 16:47:35 -0500 Original-Received: (qmail 19242 invoked by uid 3782); 1 Feb 2020 21:47:32 -0000 Original-Received: from acm.muc.de (p2E5D554B.dip0.t-ipconnect.de [46.93.85.75]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 01 Feb 2020 22:47:31 +0100 Original-Received: (qmail 11285 invoked by uid 1000); 1 Feb 2020 21:47:31 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:175573 Archived-At: Hello, Emacs. On master, with emacs -Q. Create the following file, bad-eval-when-compile.el: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmacro c-safe (&rest body) ;; safely execute BODY, return nil if an error occurred `(condition-case nil (progn ,@body) (error nil))) (defmacro foo () (error "This message should not be seen")) (eval-when-compile (c-safe (foo))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Now do M-x byte-compile-file bad-eval-when-compile.el . This erroneously throws the error: This message should not be seen . This should have been caught by the condition-case generated by (c-safe ...). As a matter of interest, if eval-when-compile is replaced by cc-eval-when-compile: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmacro cc-eval-when-compile (&rest body) `(eval-when-compile (eval '(progn ,@body)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; , then the compilation succeeds. So it would appear that there is a bug in the byte compiler's handling of eval-when-compile. -- Alan Mackenzie (Nuremberg, Germany).