unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Nicholas Drozd <nicholasdrozd@gmail.com>
Cc: 36484@debbugs.gnu.org
Subject: bug#36484: c-mode hangs on macro with comment
Date: 4 Jul 2019 10:36:20 -0000	[thread overview]
Message-ID: <20190704103620.20376.qmail__22899.1950674512$1562236713$gmane$org@mail.muc.de> (raw)
In-Reply-To: <mailman.43.1562114299.2688.bug-gnu-emacs@gnu.org>

Hello, Nicholas.

In article <mailman.43.1562114299.2688.bug-gnu-emacs@gnu.org> 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.

I can reproduce this, and I'm looking into the cause.

> 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%

Thanks, that's helpful information.

> 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

-- 
Alan Mackenzie (Nuremberg, Germany).






  parent reply	other threads:[~2019-07-04 10:36 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 [this message]
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

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='20190704103620.20376.qmail__22899.1950674512$1562236713$gmane$org@mail.muc.de' \
    --to=acm@muc.de \
    --cc=36484@debbugs.gnu.org \
    --cc=nicholasdrozd@gmail.com \
    /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).