nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
301 stars 136 forks source link

demo_apps fail to compile with gcc-arm-none-eabi 11.3.1 #94

Closed tgibson-work closed 1 year ago

tgibson-work commented 1 year ago

Describe the bug demo_apps fail to compile with gcc-arm-none-eabi 11.3.1 because of unknown type name caddr_t in core/utilities/misc_utilities/fsl_sbrk.c

To Reproduce

Expected behavior Build should compile without error

Additional context

Problem not present with ARMGCC 11.2.1

henric-jungheim commented 1 year ago

We're also seeing this problem when trying to build a project based on the 1060 EVK sample source code when using the 11.3.Rel1 ARM GCC toolchain.

mcuxsusan commented 1 year ago

Thanks for the information of this issue, has reported to the development team and it's under analysis. Feedback may be delayed, appreciate for your patience.

mcuxsusan commented 1 year ago

Update from the developer: caddr_t is defined in sys/types.h. For gcc 10, the stdio.h includes sys/types.h, in contrast, gcc 11 includes sys/_types.h. The fsl_sbrk.c include stdio.h, then it can't see caddr_t for gcc 11, need add explicitly.

Modification needed in fsl_sbrk.c:

@@ -8,6 +8,8 @@
 #if defined(__GNUC__)
 #include <stdio.h>
 #include <errno.h>
+#include <stdint.h>
+#include <sys/types.h>
 #endif

Fix will be available on github soon.

mcuxsusan commented 1 year ago

Fixed in https://github.com/NXPmicro/mcux-sdk/commit/197fbf8122ca960ad7517056ec938ea5871c13e5