unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36484: c-mode hangs on macro with comment
@ 2019-07-03  0:36 Nicholas Drozd
       [not found] ` <mailman.43.1562114299.2688.bug-gnu-emacs@gnu.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Drozd @ 2019-07-03  0:36 UTC (permalink / raw)
  To: 36484

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-07-17 14:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2019-07-17  8:22       ` Alan Mackenzie
2019-07-17 13:29         ` Nicholas Drozd
2019-07-17 14:32           ` Alan Mackenzie

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).