42School / norminette

Official 42 norminette
MIT License
956 stars 140 forks source link

Compound literals with explicit variable identification getting picked up as assignment in control strcuture #471

Open DaveeHorvath opened 10 months ago

DaveeHorvath commented 10 months ago

Describe the bug Norminette considers compound literals an assignment in control structure if and only if you name the variables.

Code in question

typedef struct s_stct
{
    int i;
    int j;
} t_stct;
int get_res(t_stct s, int a, int b, int c);

//Allowed:
if (get_res((t_stct){val1, val2}, 1, 2, 3) == 1)
    return (1);

//Disallowed
if (get_res((t_stct){.i = val1, .j = val2}, 1, 2, 3) == 1)
    return (1);