'Char' é promovido para 'int' quando passado em C
Eu tenho uma pergunta. Eu tenho linha no meu programa:
sprintf(buff,"Nieznany znak: %d",(char)va_arg(x, const char)); break;
Por que, após a compilação, tenho um erro:
error.c: In function 'error':
error.c:30:46: warning: 'char' is promoted to 'int' when passed through '...' [e
nabled by default]
case 0xfe: sprintf(buff,"Nieznany znak: %d",(char)va_arg(x, const char)); brea
k;
^
error.c:30:46: note: (so you should pass 'int' not 'char' to 'va_arg')
error.c:30:46: note: if this code is reached, the program will abort
Na minha opinião, está tudo bem, por que não posso fazer isso assim?