[EXTERNAL]: Re: Why int32_t is long int on 32 Bit Intel?

Grant Edwards grant.b.edwards@gmail.com
Fri Jul 28 18:05:38 GMT 2023


On 2023-07-28, Richard Damon <Richard@damon-family.org> wrote:

> Actually, it is showing you are using the “wrong” format. If you are
> printing an int32_t, you should be using the format out of
> inttypes.h to be correct, even if it is “ugly”.

Huh. I never knew about inttype.h until now and always wondered about
the "official" way to deal with this problem. [IMO, it definitely is
ugly.]

I tended to use the %ld with a (long) cast solution -- which doesn't
generate any extra code and is easy to read, but it still didn't seem
"right".

--
Grant





More information about the Newlib mailing list