[PATCH] newlib-stdint.h: Remove 32 bit longs

Hans-Bernhard Bröker HBBroeker@t-online.de
Mon Aug 22 20:27:00 GMT 2016


Am 22.08.2016 um 18:09 schrieb Andy Ross:
> The reproduction is straightforward.  Just build any cross gcc with
> --enable-newlib (e.g. the one in the Zephyr SDK) and compile this
> (on any 32 or 64 bit 2's complement architecture) with newlib's
> headers.
>
>     #include <stdint.h>
>
>     extern void takes_fmt(const char *fmt, ...)
>         __attribute__ ((format (printf, 1, 2)));
>
>     void foo()
>     {
>         int32_t x = 42;
>         takes_fmt("%d", x);
>     }
>

Let me boil this down:

That code is _wrong_.  Trying to base any decision on its behaviour can 
only be wrong, too.



More information about the Newlib mailing list