inttypes.h fails to define PRIi64 and friends with newlib

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

inttypes.h fails to define PRIi64 and friends with newlib

2,129件の閲覧回数
stefanct
Contributor IV

Basically what Jonathan wrote in his Debian bug report also applies to MCUXpresso (11.9.0, I havent tried .1 yet): https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067692

This can be reproduced in the hello world example for any i.mx rt device (I have only tested RT1021):

  1. switch to any newlib or newlib-nano configuration in the linker section of the project configuration,
  2. add #include <inttypes.h>
  3. change the output statement to PRINTF("Hello World %" PRId64 "\r\n", 42ULL);

Building will then fail with:

error: expected ')' before 'PRId64'

Adding the workaround of adding #include <sys/_stdint.h> before inttypes.h makes it build as explained in the bug report.described

タグ(1)
3 返答(返信)

2,033件の閲覧回数
kstribrnAmzn
Contributor I

I found the same issue to exist in both the 11.9.1 and 11.8.1 releases. As suggested in the bug report adding `#include <sys/_stdint.h>` before `#include <inttypes.h>` does seem to do the trick but this is obviously not a good long term work around.

I was testing with the pub-sub demo from https://github.com/FreeRTOS/iot-reference-nxp-rt1060.

0 件の賞賛
返信

2,087件の閲覧回数
AdrianOltean
NXP Employee
NXP Employee

Note that Newlib/NewlibNano libraries are not under the control of the IDE. The MCUXpresso IDE bundles an unmodified form of the GNU ARM Embedded Toolchain comprising the GNU compiler and supporting runtime including newlib / newlib-nano.

Regards,

Adrian

0 件の賞賛
返信

2,102件の閲覧回数
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @stefanct,

Thanks for reporting this issue. I will relay it to the IDE team for their consideration.

BR,
Edwin.

0 件の賞賛
返信