GNU bug report logs - #64133
CC Mode 5.35.2 (C/*l); incorrect indentation for an arrays of structs.

Previous Next

Package: emacs;

Reported by: Jeff Norden <norden.jeff <at> gmail.com>

Date: Sat, 17 Jun 2023 15:05:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


Message #17 received at 64133 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Jeff Norden <norden.jeff <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 64133 <at> debbugs.gnu.org
Subject: Re: bug#64133: CC Mode 5.35.2 (C/*l); incorrect indentation for an
 arrays of structs.
Date: Sun, 18 Jun 2023 13:13:56 +0000
Hello, Jeff

Thanks for taking the trouble to report this bug.

On Sat, Jun 17, 2023 at 12:36:30 -0500, Jeff Norden wrote:
> On Sat, Jun 17, 2023 at 11:27 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> > Thanks, I will let Alan chime in and decide whether this should be
> > closed.

I think, not yet.

> Actually, I now think that changing the style works because the gnu
> style has
>   (substatement-open . +)
> in c-offsets-alist, while linux uses (substatement-open . 0).  With
> either style, I initially get substatemnt syntax from "C-c C-s", which
> changes to brace-list when I delete space and re-indent.

> This issue *doesn't* occur if the opening brace is on its own line,
> and it looks like most styles other than gnu do not indent
> sub-statements.  So, I still think this bug can be closed, but maybe
> the resolution could be "mostly harmless" :-).

I've edebugged through c-guess-basic-syntax and subroutines, and it's
now clear there's a bug in the handling of a cache.  The cache, called
c-laomib-cache (with "laomib" standing for "looking at or maybe in
bracelist") speeds up the handling of very large brace lists which
frequently occur in generated .h files.  Without the cache, these would
have to be scanned over repeatedly, which made C Mode very slow for
these files.

I think I should be able to fix this in the next day or three.

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 1 year and 327 days ago.

Previous Next


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