stormalf / chibicc

A small C compiler from rui314
MIT License
6 stars 1 forks source link

ISS-148 compiling VLC failed with storage class specifier not allowed caused by static_assert function #36

Closed stormalf closed 1 year ago

stormalf commented 1 year ago

compiling VLC failed with storage class specifier not allowed caused by static_assert function ./issues/issue148.c:6: typedef struct ^ parse.c : in declspec : storage class specifier is not allowed in this context

stormalf commented 1 year ago

it was caused by fix on issue 127 that caused this bug. Fixed by adding a test on ty pointer: // fix issue =====#127 and issue =====#126 with old C style function // fixing issue ISS-148 if (equal(tok, "(") && !is_typename(tok->next) && !ty) { is_old_style = check_old_style(rest, tok, ty); if (is_old_style) return func_params2(rest, tok->next, ty); }