GNU bug report logs - #54743
CC Mode 5.35.1 (C/*l); Incorrect fontification of function call as function name

Previous Next

Package: cc-mode;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Wed, 6 Apr 2022 02:06:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 54743 <at> debbugs.gnu.org
Subject: bug#54743: CC Mode 5.35.1 (C/*l); Incorrect fontification of function call as function name
Date: Sat, 9 Apr 2022 15:13:15 +0000
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).




This bug report was last modified 3 years and 39 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.