質問

I accidentally declared an array without a length by writing enum foo bar[];, and gcc gave me the warning "array 'bar' assumed to have one element".

Is there any way to make gcc turn this into an error, instead of just warning me and assuming I meant enum foo bar[1]? I can't think of any circumstances under which I'd purposely leave out an array's length.

役に立ちましたか?

解決

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

You can use -Werror to turn all warnings into errors. I couldn't find an option to turn only that one into an error.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top