From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#36484: c-mode hangs on macro with comment Date: 4 Jul 2019 13:34:23 -0000 Organization: muc.de e.V. Message-ID: <20190704133423.88899.qmail__30272.0042689302$1562247346$gmane$org@mail.muc.de> References: Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="164922"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: tin/2.4.2-20171224 ("Lochhead") (UNIX) (FreeBSD/11.2-RELEASE-p9 (amd64)) Cc: 36484@debbugs.gnu.org To: Nicholas Drozd Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 04 15:35:42 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hj1tl-000gmB-Vz for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2019 15:35:42 +0200 Original-Received: from localhost ([::1]:46146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj1tj-00047f-Lb for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jul 2019 09:35:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51180) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hj1tO-00045q-3W for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 09:35:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hj1tL-0006Ez-Ew for bug-gnu-emacs@gnu.org; Thu, 04 Jul 2019 09:35:16 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41756) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hj1tA-000667-33; Thu, 04 Jul 2019 09:35:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hj1t9-0001oQ-TI; Thu, 04 Jul 2019 09:35:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 04 Jul 2019 13:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36484 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 36484-submit@debbugs.gnu.org id=B36484.15622472726918 (code B ref 36484); Thu, 04 Jul 2019 13:35:02 +0000 Original-Received: (at 36484) by debbugs.gnu.org; 4 Jul 2019 13:34:32 +0000 Original-Received: from localhost ([127.0.0.1]:50577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hj1se-0001nW-1U for submit@debbugs.gnu.org; Thu, 04 Jul 2019 09:34:32 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:23570 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1hj1sc-0001nK-OQ for 36484@debbugs.gnu.org; Thu, 04 Jul 2019 09:34:31 -0400 Original-Received: (qmail 88900 invoked by uid 3782); 4 Jul 2019 13:34:23 -0000 In-Reply-To: X-Newsgroups: gnu.emacs.bug 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162054 Archived-At: Hello again, Nicholas. In article you wrote: > Here's a simple C program: > #define x /***/5 > int main(void) { > return x; > } > `gcc -Wall` compiles it without any warnings, but opening it causes > Emacs to hang, and sometimes even to freeze hard. > It has something to do with the macro, but I haven't been able to > figure out exactly what's going on. There was an infinite loop in c-end-of-macro, now fixed. [ .... ] > Running that function under the profiler suggests that the problem is > in `c-end-of-macro`: Indeed, so. [ .... ] I've committed a patch to the Emacs repository master branch. Would you please update your copy of master, and confirm the bug is indeed fixed (or else, tell me what's still wrong). > GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) > of 2019-06-30 Thanks for taking the trouble to report this bug, and thanks even more for making it such an easy to follow report, and doing so much diagnosis on it. -- Alan Mackenzie (Nuremberg, Germany).