inttypes.h fails to define PRIi64 and friends with newlib

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

inttypes.h fails to define PRIi64 and friends with newlib

515 次查看
stefanct
Contributor III

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 回复数

419 次查看
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 项奖励
回复

473 次查看
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 项奖励
回复

488 次查看
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 项奖励
回复