emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#36484: closed (c-mode hangs on macro with comment)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#36484: closed (c-mode hangs on macro with comment)
Date: Wed, 17 Jul 2019 08:23:01 +0000

Your message dated Wed, 17 Jul 2019 08:22:10 +0000
with message-id <20190717082210.GA5596@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
address@hidden.)


-- 
36484: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=36484
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: c-mode hangs on macro with comment Date: Tue, 2 Jul 2019 19:36:52 -0500
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



--- End Message ---
--- Begin Message --- Subject: Re: bug#36484: c-mode hangs on macro with comment Date: Wed, 17 Jul 2019 08:22:10 +0000 User-agent: Mutt/1.10.1 (2018-07-13)
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).


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]