Sublime Forum

Syntax falsely flagged (red marking) with C compound literal

#1

Sublime Text is falsely flagging a mismatched parenthesis (marked with red background) in C code.

I tried to cut it down to the smallest possible file that compiles without error/warning and still has the wrong red marking in the editor:

sublime_red_paren

I have used similar/same syntax without ever having a problem before.

Here is the code as text:

    struct Meta {
        int a;
    };
    struct RstrView {
        const char *str;
        int         len;
    };
    struct Meta* s_new_from_view(struct RstrView rv);
    void rstr_new_from_view(const char *sv, int len)
    {
        struct Meta *meta = s_new_from_view( (struct RstrView){ .str = sv, .len = len });
        (void) meta;
    }
0 Likes