Forum Discussion
David Vescovi
Mar 26, 2021Copper Contributor
suppress incompatible pointer types in Azure RTOS demo program
I am bringing up Azure RTOS on a new ARM M4 platform.
Most everything is built and running. I patterned the port closely after the Microchip https://github.com/azure-rtos/getting-started/blob/master/Microchip/ATSAME54-XPRO ARM M4 getting stated platform.
I removed the Azure IoT main.c and replaced it with the simple demo test program as described on https://docs.microsoft.com/en-us/azure/rtos/threadx/chapter6
When I compile I am getting this warning/error that do not know how to suppress:
Can some one help?
ty_module/inc -IC:/ti/workspace_v10_test/getting-started/core/lib/netxduo/addons/azure_iot/azure_iot_security_module/iot-security-module-core/inc -I../lib/ti_start/config -I../lib/ti_start/src -Ic:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/third_party/CMSIS/Include -IC:/ti/workspace_v10_test/getting-started/core/src/. -IC:/ti/workspace_v10_test/getting-started/core/src/azure_iot_mqtt -IC:/ti/workspace_v10_test/getting-started/core/src/azure_iot_nx -IC:/ti/workspace_v10_test/getting-started/core/lib/jsmn/src -I../lib/netx_driver/src -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 --specs=nano.specs -ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin -fshort-enums -Wall -Wextra -Wuninitialized -Wshadow -Wdouble-promotion -Werror -Wno-unused-parameter -Wno-old-style-declaration -O0 -g3 -std=gnu99 -MD -MT app/CMakeFiles/msp432e_azure_iot.dir/maindemo.c.obj -MF app\CMakeFiles\msp432e_azure_iot.dir\maindemo.c.obj.d -o app/CMakeFiles/msp432e_azure_iot.dir/maindemo.c.obj -c ../app/maindemo.c
../app/maindemo.c: In function 'tx_application_define':
../app/maindemo.c:79:36: error: passing argument 2 of '_txe_byte_allocate' from incompatible pointer type [-Werror=incompatible-pointer-types]
79 | tx_byte_allocate(&byte_pool_0, &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
| ^~~~~~~~
| |
| CHAR ** {aka char **}
In file included from ../app/maindemo.c:10:
C:/ti/workspace_v10_test/getting-started/core/lib/threadx/common/inc/tx_api.h:1396:63: note: expected 'void **' but argument is of type 'CHAR **' {aka 'char **'}
1396 | UINT _txe_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
../app/maindemo.c:87:36: error: passing argument 2 of '_txe_byte_allocate' from incompatible pointer type [-Werror=incompatible-pointer-types]
87 | tx_byte_allocate(&byte_pool_0, &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
| ^~~~~~~~
| |
| CHAR ** {aka char **}
In file included from ../app/maindemo.c:10:
C:/ti/workspace_v10_test/getting-started/core/lib/threadx/common/inc/tx_api.h:1396:63: note: expected 'void **' but argument is of type 'CHAR **' {aka 'char **'}
1396 | UINT _txe_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
../app/maindemo.c:97:36: error: passing argument 2 of '_txe_byte_allocate' from incompatible pointer type [-Werror=incompatible-pointer-types]
97 | tx_byte_allocate(&byte_pool_0, &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
| ^~~~~~~~
| |
| CHAR ** {aka char **}
In file included from ../app/maindemo.c:10:
C:/ti/workspace_v10_test/getting-started/core/lib/threadx/common/inc/tx_api.h:1396:63: note: expected 'void **' but argument is of type 'CHAR **' {aka 'char **'}
1396 | UINT _txe_byte_allocate(TX_BYTE_POOL *pool_ptr, VOID **memory_ptr, ULONG memory_size,
../app/maindemo.c:103:36: error: passing argument 2 of '_txe_byte_allocate' from incompatible pointer type [-Werror=incompatible-pointer-types]
103 | tx_byte_allocate(&byte_pool_0, &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
| ^~~~~~~~
| |
| CHAR ** {aka char **}
In file included from ../app/maindemo.c:10:
1 Reply
- David VescoviCopper ContributorI was able to get it to compile by adding a cast in front of the &pointer ((void **)&pointer) but don't think that's the best way to handle.