cs50 / style50

https://cs50.readthedocs.io/style50/
GNU General Public License v3.0
61 stars 31 forks source link

style50 doesn't properly lint C compound literal syntax #100

Open Vivraan opened 3 years ago

Vivraan commented 3 years ago

Where something like

RGBTRIPLE s =
{
    clampf_0_255(mag(g_x[2], g_y[2])),
    clampf_0_255(mag(g_x[1], g_y[1])),
    clampf_0_255(mag(g_x[0], g_y[0]))
};

temp[y][x] = s;

is understood, switching to a compound literal

temp[y][x] = (RGBTRIPLE)
{
    clampf_0_255(mag(g_x[2], g_y[2])),
    clampf_0_255(mag(g_x[1], g_y[1])),
    clampf_0_255(mag(g_x[0], g_y[0]))
};

shows up as:

image