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

Harald Kipp harald.kipp at egnite.de
Thu Mar 18 19:30:10 CET 2004


>>
>>Jan, what's your opinion about switching to -mint32?
>
>In previous post I forgot to say that adding this option will not solve 
>problems with format strings.
>Although still I don't mind. :-)

I'm sure it will. %d and %u are intended for
ints and if ints are 32 bit, size_t should be
unsigned int.

If the compiler insists on using unsigned long
and is too dumb to recognize, that %d or %u
will still work for longs in this environment,
we can easily override the size_t typedef.

But usually GCC is smart.


Harald




More information about the En-Nut-Discussion mailing list