I am not sure what you're trying to do here, but you are re-declaring a
as both a static and external variable, in different order.
When applied to a variable, static
allows global variables to only be visible within that file. extern
declares an external variable, defined elsewhere. So for example you would declare a
as extern if it was originally defined in a separate file, and declare it as static
if it should only be visible within this file itself.
Here are the errors:
test.c:8:12: error: static declaration of ‘a’ follows non-static declaration
test.c:7:12: note: previous declaration of ‘a’ was here
You declare a
as an external variable (defined in a different file), but then re-declare it as static, only visible within this file.
In this case I would review what those storage classes (extern, static, etc) mean and then decide how your variable should be declared.
TRUE
is defined, but not if it isn't.extern
declaration after parsing thestatic
one.