[newlib] print formats for FAST and LEAST types
Tue Jul 14 13:56:00 GMT 2015
On Jul 14 12:17, Andre Vieira wrote:
> Kevin Bracey commented on Launchpad that he was having issues with a
> mismatch between <inttypes.h> and <stdint.h> when printing an int_fast32_t.
> See https://answers.launchpad.net/gcc-arm-embedded/+question/269083
> This is due to the fact that on targets where the size of ‘int’ and ‘long’
> are equal and 32 bits, the current header files will configure the type of
> int_fast32_t to be ‘int’ and PRIdFAST32 to be ‘ld’ and make printf thus
> expect a ‘long’. The macro’s used in <stdint.h> come from
Are you looking into an older version of newlib by any chance? We
added code to newlib's headers to check explicitely at runtime whether
__INT32_TYPE__ is int or long, and set the PRIxxx32 macros accordingly.
I just checked this on 32 bit Cygwin:
$ gcc -E - <<EOF
If there's still anything wrong with that, feel free to send patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: not available
More information about the Newlib