Re:Useful GCC warning options not enabled by -Wall -Wextra
by microtherion on Wednesday October 04, 2017 @04:55PM
(#15404558)
A simple case is the warning clang will generate for:
This is indeed a useful warning, as it's common to mistype == as = in this situation, but it's also absolutely correct code, and the idiom that silences the warning (surrounding with extra parentheses) does not change anything about the correctness of the code.
[ Parent
| on HN ]
Re:Useful GCC warning options not enabled by -Wall -Wextra
by makapuf on Thursday October 05, 2017 @02:56AM
(#15407122)
A hint could be that you're initializing to zero a local just to overwrite it. Not an error or a warning but it could hint that you did not mean to, isn't it ?
Re:Useful GCC warning options not enabled by -Wall -Wextra
by microtherion on Thursday October 05, 2017 @04:23PM
(#15412313)
The initialization is just an example to show that err is a previously declared variable. The actual code could easily be different, but the warning is emitted on seeing the assignment in the conditional.