Donate Share

Uncrustify Code Beautifier

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Bad indent inside preprocessor #if #endif

You are viewing a single message from this topic. View all messages.

  1. 2009-06-29 19:33:30 UTC
    I am getting indent or aligning issues on this block of code, after running uncrustify 0.53. Below is the original code segment, which I want to keep exactly as-is (note the braces).

    {
    int some_integer
    #if defined(WIN32)
    SYSTEMTIME st;
    DWORD ThreadId;
    #else
    struct timeval mytv;
    struct tm * mytm;
    pid_t ProcessId;
    #endif

    #if SOME_COND
    (void) loop;
    #endif
    }

    uncrustify will always give me 1 extra indent on the last #if block, like below

    #if EV_MULTIPLICITY
    (void) loop;
    #endif

    But the extra indent does not kick in on any other line. Also, I ran the same config file on uncrustify .47 and I did not get this problem. Does anybody know if this is a bug, or simply a feature I missed in my config file?

    Here's a list of rules from my config which are relevant,

    input_tab_size=4
    output_tab_size=4
    string_escape_char=92
    indent_columns=4
    align_pp_define_span=0
    pp_region_indent_code=false
    pp_define_at_level=false
    pp_indent_at_level=true
    pp_indent_if=1
    pp_indent=ignore
    pp_if_indent_code=false

< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.