You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to control a designated initializer list alignment (C lang)? #967
Hi,
I am running 0.64_d version here.
Is there a way to control the alignment of the designated initialization list?
Here is an example: https://bitbucket.org/adel-mamin/uncrustify-test.git
My original file is in.c. What I get after running uncrustify is in out.c
You can see that it removes the manually added alignment of the initialization list.
I want it to be like in the in.c file. So how to control it?
Thanks!
That's a very good question. I suspect that uncrustify doesn't really support C99 designated initializers. Actually I'm not sure if all compilers do (at least non-trivial ones)...
The example configuration file can be found behind the link above. The problem is that uncrustify does not seem to allow control of alignment of C99 designated initializers. I am not quite sure I understand what is meant by important options here.
The problem is having a struct initializer inside a struct initializer inside something.
uncrustify can't yet deal with that.
The output are not predictable.
The problem is having a struct initializer inside a struct initializer inside something.
uncrustify can't yet deal with that.
The output are not predictable.
Activity
mihaipopescu commentedon Jan 27, 2017
That's a very good question. I suspect that uncrustify doesn't really support C99 designated initializers. Actually I'm not sure if all compilers do (at least non-trivial ones)...
guy-maurel commentedon May 3, 2017
Please push a configuration file with only the important options
adel-mamin commentedon Aug 13, 2017
The example configuration file can be found behind the link above. The problem is that uncrustify does not seem to allow control of alignment of C99 designated initializers. I am not quite sure I understand what is meant by important options here.
guy-maurel commentedon Jun 4, 2018
The problem is having a struct initializer inside a struct initializer inside something.
uncrustify can't yet deal with that.
The output are not predictable.
Related to #1293, #1349, #1601, #1727
nikiwaibel commentedon Mar 5, 2019
i just wrote this code …
… and had to use
/* *INDENT-OFF* */and/* *INDENT-ON* */🤔guy-maurel commentedon Apr 4, 2019
The problem is having a struct initializer inside a struct initializer inside something.
uncrustify can't yet deal with that.
The output are not predictable.
Related to #967, #1293, #1349, #1601, #1727, #1848