Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top