Compilation warning "comparison of integer expressions of different signedness"
BullyWiiPlaza opened this issue · 3 comments
BullyWiiPlaza commented
The following code produces a warning about comparing integer expressions of different signedness:
void AES::printHexArray(unsigned char a[], unsigned int n) {
for (int i = 0; i < n; i++) { // <--
printf("%02x ", a[i]);
}
}
The fix is to simply declare i
as an unsigned int
.
SergeyBel commented
What command do you use to compile?
BullyWiiPlaza commented
I use GCC
with the command line flags -Wall
and -Wextra
which enable more warnings than you get by default.