Re: bug#54743: CC Mode 5.35.1 (C/*l); Incorrect fontification of function call as function name

Alan Mackenzie <[email protected]> Sat, 9 Apr 2022 15:13:15 +0000
Newsgroups gmane.emacs.cc-mode.general
Message-ID <YlGii0Qps3ebaeSj@ACM>
Hello, Po.

On Wed, Apr 06, 2022 at 10:05:36 +0800, Po Lu via CC-Mode-help wrote:
> Package: cc-mode

> Open src/haikumenu.c in the Emacs source code, and go to line 352.  The
> calls to `process_pending_signals' and `internal_catch_all' are
> fontified as function names, which is wrong.

> Thanks.

This bug has the same cause as bug #52796, namely that a function's type
contains the keyword struct, and an internal CC Mode cache thus thinks
that the function's { is a struct's {, and that we are thus still at
"top level".  The "fix" to that bug was to handle the * in "struct foo
*" specially, but that wasn't a good enough fix for when "struct foo"
occurs without a *, as here.

So, the cause of the bug is understood.  The challenge will be to fix it
without unduly slowing down CC Mode.  That's not going to happen this
afternoon, I'm afraid.

> Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-unknown-haiku, Haiku R1/beta3, cairo version 1.16.0)
>  of 2022-04-06
> Package: CC Mode 5.35.1 (C/*l)
> Buffer Style: GNU
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit)


[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).