unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicholas Drozd <nicholasdrozd@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 36484@debbugs.gnu.org
Subject: bug#36484: c-mode hangs on macro with comment
Date: Thu, 4 Jul 2019 12:08:14 -0500	[thread overview]
Message-ID: <CABAiW0o76JNaot+RaEZxpLsxmqQwZ4timRbgPHh+Dc8Be4NAPw@mail.gmail.com> (raw)
In-Reply-To: <20190704133423.88899.qmail@mail.muc.de>

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

Works for me! Attached is a patch for an added cc-mode test case.

By the way, I came across this issue because a similar line appears in
a winning entry to the 1988 International Obfuscated C Code Contest
(https://www.ioccc.org/1988/dale.c). That line is included in the test
case.

Trivia question: which Emacs maintainer is a past IOCCC winner?

[-- Attachment #2: 0001-test-lisp-progmodes-cc-mode-tests.el-Add-test-for-bu.patch --]
[-- Type: text/x-patch, Size: 979 bytes --]

From 569c10a367edb261a45d41f119d98e3bc932d135 Mon Sep 17 00:00:00 2001
From: Nick Drozd <nicholasdrozd@gmail.com>
Date: Thu, 4 Jul 2019 10:59:25 -0500
Subject: [PATCH] * test/lisp/progmodes/cc-mode-tests.el: Add test for
 bug#36484

---
 test/lisp/progmodes/cc-mode-tests.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/lisp/progmodes/cc-mode-tests.el b/test/lisp/progmodes/cc-mode-tests.el
index 0b8f37dbbf..c10105fffc 100644
--- a/test/lisp/progmodes/cc-mode-tests.el
+++ b/test/lisp/progmodes/cc-mode-tests.el
@@ -69,4 +69,13 @@ c-or-c++-mode
               "struct template {"
               "#include <string.h>")))))
 
+(ert-deftest c-mode-macro-comment ()
+  "Test for bug#36484."
+  (dolist (macro-string '("#define /***/f"
+                          "#define x /***/5"
+                          "#define a(x)get/***/x/***/id())"))
+    (with-temp-buffer
+      (insert macro-string)
+      (c-mode))))
+
 ;;; cc-mode-tests.el ends here
-- 
2.17.1


  parent reply	other threads:[~2019-07-04 17:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  0:36 bug#36484: c-mode hangs on macro with comment Nicholas Drozd
     [not found] ` <mailman.43.1562114299.2688.bug-gnu-emacs@gnu.org>
2019-07-04 10:36   ` Alan Mackenzie
2019-07-04 13:34   ` Alan Mackenzie
     [not found]   ` <20190704133423.88899.qmail@mail.muc.de>
2019-07-04 17:08     ` Nicholas Drozd [this message]
2019-07-17  8:22       ` Alan Mackenzie
2019-07-17 13:29         ` Nicholas Drozd
2019-07-17 14:32           ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABAiW0o76JNaot+RaEZxpLsxmqQwZ4timRbgPHh+Dc8Be4NAPw@mail.gmail.com \
    --to=nicholasdrozd@gmail.com \
    --cc=36484@debbugs.gnu.org \
    --cc=acm@muc.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).