GNU bug report logs -
#36484
c-mode hangs on macro with comment
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Wed, 17 Jul 2019 08:22:10 +0000
with message-id <20190717082210.GA5596 <at> ACM>
and subject line Re: bug#36484: c-mode hangs on macro with comment
has caused the debbugs.gnu.org bug report #36484,
regarding c-mode hangs on macro with comment
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
36484: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36484
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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.
Here's a test function with an even smaller reproducing example:
(defun c-mode-hang ()
(interactive)
(with-temp-buffer
(insert "#define /***/5")
(c-mode)))
Running that function under the profiler suggests that the problem is
in `c-end-of-macro`:
- c-extend-region-for-CPP 13869 98%
- c-end-of-macro 10470 74%
c-forward-single-comment 2759 19%
This may have something to do with commit 39acaf, or maybe 6b5388.
GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2019-06-30
[Message part 3 (message/rfc822, inline)]
Hello, Nicholas.
On Thu, Jul 04, 2019 at 12:08:14 -0500, Nicholas Drozd wrote:
> Works for me!
That's great, thanks. I'm closing the bug with this post.
> Attached is a patch for an added cc-mode test case.
The patch works fine, too, thanks. But I got bogged down on the
copyright assignment sort of things for the patch.
Have you signed copyright assignment papers for Emacs? (I think you
have, judging by the number of commits in your name, but I don't know
where to look to check.)
Otherwise, it would appear that your patch is a "trivial" patch, in that
it is less than 15 lines long. But I think that only applies when the
total number of lines you've contributed to Emacs is less than about 15.
So, sorry about all this non-creative stuff, but would you please tell
me whether or not you've signed an Emacs copyright assignment. Then I
should be able to commit your patch.
> 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?
I don't know (and haven't cheated by researching it ;-), but if I had to
guess, I'd say Paul Eggert.
[ snip patch ].
--
Alan Mackenzie (Nuremberg, Germany).
This bug report was last modified 6 years and 2 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.