문제

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