9
The code generating the warning, passing argument 1 of 'isHex' with different width due to prototype:
/* Checks if a character is either 0-9 or A-F */
int isHex(char ch) {
return isdigit(ch) || (ch >= 65 && ch <= 70);
}
/* Checks if a string only contains numeric characters or A-F */
int strIsHex(char * str) {
char *ch;
size_t len = strlen(str);
for(ch=str;ch<(str+len);ch++) {
if (!isHex(*ch)) return 0;
}
return 1;
}
What does this mean, shouldn't the char values be the be same width? How can I cast them to the same width to prevent this warning?
By the way, the gcc command was: gcc.exe -std=c99 -fgnu89-inline -pedantic-errors -Wno-long-long -Wall -Wextra -Wconversion -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fshort-enums -gstabs -l"C:\program files\quincy\mingw\include" -o main.o -c main.c
I can't remove any of the warning options from gcc as one of the marking criteria for an assignment is that there are no errors or warnings with this command.
Thanks.