[En-Nut-Discussion] H8/300 Question: Print Format Specifier For size_t

Jan Dubiec jdx at slackware.pl
Wed Mar 17 21:19:13 CET 2004


Harald Kipp wrote:

> Jan,
>
> At 19:28 17.03.2004 +0100, you wrote:
>
>> Yes, size_t is 32 bit but when I tried to compile the original code
>> using h8300-elf-gcc (or arm-elf-gcc) I got following warning:
>>
>> httpserv.c:442: warning: unsigned int format, size_t arg (arg 3)
>
>
> I understand. Or more exactly, I understood your
> problem, but I do not understand the warning.

AFAIR on H8/300H gcc size_t is defined as unsigned long int but I can't 
check this because I am not on Linux at the moment. This even make sense 
since int on H8/300H is 16 bit by default. Of course it may be also 32 
bit if appropriate compiler option is specified (-mint32). In both cases 
H8/300H can address more than 64KiB so having size_t defined as unsigned 
long int is convenient. I have successfuly tested Nut/OS with both 
integer sizes although I have choosen 16 bit int due to a little smaller 
binary code.

I suspect that situation with ARMs is simialar, i.e. I *suspect* that 
int in THUMB mode is 16 bit.
But I don't know ARMs, until then I have seen them only on photos and in 
a few commercial devices. :-)

Regards,
/J.D.




More information about the En-Nut-Discussion mailing list