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

ml mludwig at adc-elektronik.de
Fri Feb 8 18:32:30 CET 2008


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

 
-- 
View this message in context: http://www.nabble.com/sscanf--bug-or-feature----hx-tp15309888p15360184.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list