gcc 4.4.1 c89
I have the following code:
static enum states { ACTIVE, RUNNING, STOPPED, IDLE };
And I get a warning:
useless class storage specifier in empty declaration
However, if i remove the static keyword I don't get that warning.
I am compiling with the following flags:
-Wall -Wextra
Many thanks for any suggestions,
You get the message because you're not actually declaring, you're only defining something, namely an enumeration named "states". You can later use this definition to declare a variable of that type. That variable may be a static or instance variable, but the definition doesn't need (and shouldn't have) the storage specifier attached to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With