Skip to content

C : struct init aligment does't work with macro #1601

Open

Description

@tn1057

Using the following config :

  • align_struct_init_span = 1
  • sp_after_comma = force

on this code :

static CONST wrl_sttyCommandTable wrl_stPRODUCTION_MODE[] =
{
  wrl_astDISCONNECT_TABLE_ENTRIES,
  {"AT+UW%sCA=0,4\r",             123456,NULL, 0, 1, U16_LINE, 10000}, //BT Scan Infos
  {NULL,                          NULL,  NULL, 0, 0, 0,        0    } // Ende
};

the output is the same as input. But if i change the element 123456 to a number which has more than 6 digits for example 1234567, i will get the false output

static CONST wrl_sttyCommandTable wrl_stPRODUCTION_MODE[] =
{
  wrl_astDISCONNECT_TABLE_ENTRIES,
  {"AT+UW%sCA=0,4\r",             1234567,NULL, 0, 1, U16_LINE, 10000}, //BT Scan Infos
  {NULL,                          NULL,  NULL, 0, 0, 0,        0    } // Ende
};

the table receives a correct format without using macro wrl_astDISCONNECT_TABLE_ENTRIES

Activity

  1. changed the title [-]struct init aligment does't works with macro[/-] [+]C : struct init aligment does't works with macro[/+] on Feb 9, 2018
  2. changed the title [-]C : struct init aligment does't works with macro[/-] [+]C : struct init aligment does't work with macro[/+] on Feb 9, 2018
  3. guy-maurel commented on Mar 13, 2018

    @guy-maurel
    Contributor

    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

  4. guy-maurel commented on Jun 4, 2018

    @guy-maurel
    Contributor

    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, #1727

  5. guy-maurel commented on Apr 4, 2019

    @guy-maurel
    Contributor

    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, #1727, #1848

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions