I'm use to use gcc and g++ with -Wall and -Wextra flags since I don't want my code to contain any warnings. Sometimes I understand the reason why I should solve the warnings that comes up after compiling but some other times I don't. One example is the following warning:
warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
To solve this warning I check the consistency of the int
(or unsigned int
, it depends on the cases) and the convert one type to the other. My question is: what are the possible hazard of not perform this checks?