+CLI Function prototype inconsistency with documentation

Ive noticed some inconsistency with the function prototypes in relation to command handlers.

e.g. in the documentation at Implementing a user defined command to use with the FreeRTOS+CLI command line interpreter

pcWriteBuffer and pcCommandString are int8_t’s, whereas in FreeRTOS_CLI.h they are both char.

At least with the Microchip xc32 compiler, this generates a warning “initialization from incompatible pointer type” for the pxCommandInterpreter member since I had copy/pasted the function prototype from the web document.

Changing the types to char resolves the compiler warning. Is it worth updating the documentation to reflect the char type if this has changed?

In addition to this, there seems to be some inconsistency with the examples for FreeRTOS_CLIGetParameter().

This function returns a const char *, so without defining my pointers as const char * the compiler moans about discarding the const qualifier.

But the example at Implementing a user defined command to use with the FreeRTOS+CLI command line interpreter suggests writing a null char after each parameter, which cant be done when you have a const char pointer. :slight_smile:

Thanks for taking the time to report these. I have changed the int8_t to char in the online docs although you won’t see the changes until the next website deployment. Looking into the second issue.

1 Like