Skip to content

wrong indentation with default settings in some enum (C code) #1315

Closed

Description

@pksadiq

Source (C Program, say, write in file.c):

typedef enum
{
  A = 0,
  B = 1 << 0,
  C = 1 << 1
};

indenting the file with uncrustify with default settings (eg, with an empty cfg file), results in the following indentation:

typedef enum
{
        A = 0,
        B = 1 << 0,
                C = 1 << 1
};

This was tested using uncrustify from current git master.

Thanks

Activity

  1. guy-maurel commented on Sep 25, 2017

    @guy-maurel
    Contributor

    The problem is that the << is interpreted as CT_ARITH.
    We have to found some more deinitions for it.
    Please test if you could use the option:
    align_left_shift = false
    and report.

  2. guy-maurel commented on Sep 27, 2017

    @guy-maurel
    Contributor

    Thank for the message.
    Please test and report.

  3. added a commit that references this issue on Sep 28, 2017
  4. added a commit that references this issue on Sep 28, 2017
  5. pksadiq commented on Sep 30, 2017

    @pksadiq
    Author

    Sorry for the delay. The applied patch seems to fix the issue. I have only tested with the above test cause though. Hopefully this can be closed.

    Thanks

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