I have this code:
PRINT_VALUE("Displaying value: %x",A->B.C.D);
D is of type unsigned short.
#define PRINT_VALUE(Name,Val) \
if(Val){fprintf(fp,Name,Val);fprintf(fp,"\n");}\
else {fprintf(fp,Name);fprintf(fp,"\n");}
Even if I use %d and cast A->B.C.D to int, the same warning persists. Any help?
Warning message:
warning: format ‘%x’ expects a matching ‘unsigned int’ argument [-Wformat]