Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array initializer list alignment #2306

Closed
davxy opened this issue Jun 1, 2019 · 1 comment
Closed

Array initializer list alignment #2306

davxy opened this issue Jun 1, 2019 · 1 comment

Comments

@davxy
Copy link

davxy commented Jun 1, 2019

Hi,
Given this code snip:

static const unsigned char exp_tab[] = {
    32,  1,  2,  3,  4,  5,
     4,  5,  6,  7,  8,  9,
     8,  9, 10, 11, 12, 13,
    12, 13, 14, 15, 16, 17,
    16, 17, 18, 19, 20, 21,
    20, 21, 22, 23, 24, 25,
    24, 25, 26, 27, 28, 29,
    28, 29, 30, 31, 32,  1
};

I wuold like uncrustify to format it properly (indeed as it was originally above).

After parsing it it outputs the following:

static const unsigned char exp_tab[] = {
	32,  1,  2,  3,  4,  5,
	4,  5,  6,  7,  8,  9,
	8,  9, 10, 11, 12, 13,
	12, 13, 14, 15, 16, 17,
	16, 17, 18, 19, 20, 21,
	20, 21, 22, 23, 24, 25,
	24, 25, 26, 27, 28, 29,
	28, 29, 30, 31, 32,  1
};

I've tried several combinations of the following flags with no success:

  • align_number_right = tried both left/right
  • align_var_struct_span = tried 0,1,3,6 ..
  • align_var_struct_thresh = tried 0,1,3,6...
  • align_var_struct_gap = tried 0,1,3,6

At least it would be useful to instruct the tool the leave the array "as is".

@davxy davxy changed the title Prevent structure initializer list alterations Array initializer list alignment Jun 2, 2019
@gmaurel
Copy link
Collaborator

gmaurel commented Jun 4, 2019

It is a known problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants