C99 compound literals are not formatted correctly with indent's default arguments

Koz Ross <[email protected]> Tue, 5 May 2015 18:08:19 +1200
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
When I try to format the following (using indent with default arguments):

tree_node_s *t = GC_MALLOC_ATOMIC (sizeof (tree_node_s));
*t = (tree_node_s){.val = n,.h = 0};

it ends up looking like this:

tree_node_s *t = GC_MALLOC_ATOMIC (sizeof (tree_node_s));
*t = (tree_node_s)
  {
  .val = n,.h = 0};

Now, this (aside from being really ugly) is not obviously a compound literal from its appearance. This appears to be a bug.

-- 
Koz Ross <[email protected]>
www.retro-freedom.nz
If you aren't using GPG, you should be! https://emailselfdefense.fsf.org/en/
****
Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

_______________________________________________
bug-indent mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-indent
signature.asc (application/pgp-signature, 473 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVSF5TAAoJEJARVr/lAw1ArJgH/i/UoWuAFE0ETB8M1a3gUaKN
9R4YOilwPe6Ifac4YozKIXJ1jOCvgCTrpXKEyi+ulwxQHBYM9PkqKckVkQO5IM6B
V/PcIusd7r6T2JwZ5pGQJ/8CN9eNHItEJltsPapK5DP5J7eRSVlMuHJgHMFdWga1
94B+od/8otEoVHekRo/t8OCR7wMLdZP7PeZSGllu6KV3X+KAmcBd3HQ3XldBaFSx
Cs5JnY9r2TmrgujBZzxvEVCCKp72oUmLQ2T40cEViCKeTdSBDGkCHi/el1bkBijQ
7rWsjzeFMYlN71sA5KypSY2Lf2RQnHAE3IPBxyugA4YtAFBwPofBQE2KUga2UEY=
=EMBL
-----END PGP SIGNATURE-----