[En-Nut-Discussion] sscanf bug or feature ? %hx

Alain M. alainm at pobox.com
Sun Feb 10 17:21:34 CET 2008


I, personaly, never use never undocumented features or even badly 
documented. Why not use "%c" that is documented for char* ?

Alain

ml escreveu:
> Hi Alain,
> 
> short int on arm-gcc isn´t a char thats right. sizeof tells me same length
> of integer and short int both 2 bytes. So my mistake was a wrong type cast.
> (short int to char thats not realy good) 
> But i´ve seen that the "%hhx" modifier often is used for returning a char. 
> If you use hh gcc warning shows that a char is expected. 
> So i changed getf  to use hh and then all is ok. 
> 
> I think if the comiler expects such thing than scanf should do it, or am i
> wrong ?
> 
> Martin
> 
>  



More information about the En-Nut-Discussion mailing list