Menu ▾ ▴

#588 astyle 3.6.7: incorrect indentation within parenthesis

open-fixed
None
4 days ago
2025-03-02
No

Currently astyle 3.6.7 outputs:

static const struct bt_data adv_data_hids[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
    BT_DATA_BYTES(BT_DATA_GAP_APPEARANCE, BT_BYTES_LIST_LE16(BT_APPEARANCE_HID_KEYBOARD)),
    BT_DATA_BYTES(
    BT_DATA_UUID16_ALL,
    BT_UUID_16_ENCODE(BT_UUID_HIDS_VAL),
    BT_UUID_16_ENCODE(BT_UUID_BAS_VAL)
    ),
    BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

Expecting:

static const struct bt_data adv_data_hids[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
    BT_DATA_BYTES(BT_DATA_GAP_APPEARANCE, BT_BYTES_LIST_LE16(BT_APPEARANCE_HID_KEYBOARD)),
    BT_DATA_BYTES(
        BT_DATA_UUID16_ALL,
        BT_UUID_16_ENCODE(BT_UUID_HIDS_VAL),
        BT_UUID_16_ENCODE(BT_UUID_BAS_VAL)
    ),
    BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

This is with no options (just astyle test.c), and also with:

astyle --style=attach --indent=force-tab --suffix=none --indent-after-parens --align-pointer=name --align-reference=name --pad-oper --pad-header --add-braces test.c

This is with astyle 3.6.7 from Homebrew on macOS. I previously used 3.1-3 on Debian, which did not exhibit the issue.

Discussion

  • André Simon

    André Simon - 2025-03-10
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 4 days ago

    Please test with release 3.6.20.

     
  • André Simon

    André Simon - 4 days ago
    • status: open-accepted --> open-fixed
     

Log in to post a comment.