GNU bug report logs - #27130
c-mode indentation mistreats structs in function arguments

Previous Next

Packages: emacs, cc-mode;

Reported by: Sam Pagenkopf <ssaammp <at> gmail.com>

Date: Mon, 29 May 2017 16:01:02 UTC

Severity: normal

Tags: confirmed

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sam Pagenkopf <ssaammp <at> gmail.com>
Cc: 27130 <at> debbugs.gnu.org, Alan Mackenzie <acm <at> muc.de>
Subject: bug#27130: c-mode indentation mistreats structs in function arguments
Date: Mon, 30 Nov 2020 12:11:56 +0100
Sam Pagenkopf <ssaammp <at> gmail.com> writes:

> In emacs 25.2.1.
>
> Relevant code:
>
>     draw_add(&battle.draw, (Drawn){
>             .kind = DRAW_RECT,
>                 .size = {40,24},
>                 .pos.border = {
>                 .align = {ALIGN_LEFT, ALIGN_TOP},
>                 .dist = 3
>             }
>         }
>         );
>
> My guess is that it's reading (Drawn){...} as a statement, and the , as
> the (,) C operator.

I'm not sure how this should be indented (as I didn't even know that
that was valid C).  But that does look wrong, in any case.  (I've
confirmed that it indents it the same way in Emacs 28.)

Alan?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 196 days ago.

Previous Next


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