# +CLI Function prototype inconsistency with documentation

**URL:** <https://forums.freertos.org/t/cli-function-prototype-inconsistency-with-documentation/15895>\
**Category:** Libraries\
**Created:** [September 25, 2022, 3:59pm UTC](https://forums.freertos.org/t/cli-function-prototype-inconsistency-with-documentation/15895 "2022-09-25T15:59:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomstorey](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/tomstorey/32/1277_2.png) [@tomstorey](https://forums.freertos.org/u/tomstorey)\
**Post date:** [September 25, 2022, 3:59pm UTC](https://forums.freertos.org/t/cli-function-prototype-inconsistency-with-documentation/15895/1 "2022-09-25T15:59:59Z")

</div>

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](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/FreeRTOS_Plus_CLI_Implementing_A_Command.html)

`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?

---

<div class="post-metadata">

**Author:** ![tomstorey](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/tomstorey/32/1277_2.png) [@tomstorey](https://forums.freertos.org/u/tomstorey)\
**Post date:** [September 26, 2022, 6:27pm UTC](https://forums.freertos.org/t/cli-function-prototype-inconsistency-with-documentation/15895/2 "2022-09-26T18:27:47Z")

</div>

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](https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/FreeRTOS_Plus_CLI_Implementing_A_Command.html#Example_Of_Using_FreeRTOS_CLIGetParameter) suggests writing a null char after each parameter, which cant be done when you have a const char pointer. 🙂

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [September 26, 2022, 7:50pm UTC](https://forums.freertos.org/t/cli-function-prototype-inconsistency-with-documentation/15895/3 "2022-09-26T19:50:21Z")

</div>

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.
