FreeRTOS compilation issue

Hi,

I am trying to compile a project and it gives me the following error:

‘SIZE_MAX’ undeclared

I know that SIZE_MAX is present in stdint.h and FreeRTOS also provides a minimal implementation as a readme file which we can use. I am using MPLAB X IDE v5.20 with XC16 compiler v1.50. I am sure that XC16 provides stdint.h so why is the IDE giving this error?

The error goes away when I rename stdint.readme to stdint.h and place it in my include folder. But I want to know why compiler doesn’t provide the implementation. Also, stdint.h provided by FreeRTOS is a minimal implementation so my project throws further warnings related to uint16_t datatype, which is understood.

Sounds like something to ask to MPLAB support. The FreeRTOS minimal support is for the ancient compilers with no C99 support. IF that IDE has C99 support, you should be using that provided file.

Yes, the IDE provides support for C99 and I also checked in the include folder of the compiler, stdint.h is present. As you said, let me ask this on Microchip forum.

If you can spare the time, please post back your resolution once you find out more from the Microchip forum. This can help others who may run into your same issue later on.

Sure, will do that.

A correction on my previous reply is that XC16 supports C89 by default and some features of C99 standard. Mentioned in chapter 7 XC16 User guide

Quoting the reply given as of now:
To be clear - is this an error that the COMPILER is picking up or an error that the MPLABx IDE is showing?
if the former then you have an error. If the latter then that is a long standing bug with MPLABx and can be ignored.
Susan

1 Like