Some of the functions which accept no parameter when they are called. For example consider the function “void iotc_bsp_time_init ()”. This function has been declared as:
void iotc_bsp_time_init ();
but above declaration is ambiguous in C as it can be interpreted in any of following two ways:
function iotc_bsp_time_init() accepts any number of parameters of unknown type
function iotc_bsp_time_init() accepts no parameter at all.
in fact on some compiler it can result in following compile time error:
Error[Pa045]: function "iotc_bsp_time_init" has no prototype C:\data\mcd\Firmware\Middlewares\Third_Party\GCP\src\bsp\platform\B-L475E-IOT01A\iotc_bsp_time-b-l475e-iot0a.c 19
This error can be avoided using following change:
Edit corresponding .h/.c file which includes declaration and definition of this function and replace void iotc_bsp_time_init (); -> void iotc_bsp_time_init (void);
This issue is present for many other functions in "libiotc" directory.
some of the functions in .c files are not declared anywhere
functions like iotc_mqtt_logic_task_queue_shutdown() defined in file "libiotc\mqtt\logic\iotc_mqtt_logic_layer.c" are not declared anywhere. This can result in compile time warning message. This issue can be avoided by declaring this function in the beginning of this file. This issue is present with some other functions in this folder.
I propose to solve issue #1 and #2 mentioned above in my branch. Please review and accept my pull request.
This issue is resolved in my repository git@github.com:hemddabral/GCP-iot-device-sdk-embedded-c.git, in branch 'void_param_list_issue". I will create a pull request for the same.
I am trying to integrate Google cloud iot embedded device sdk to a ST MCU platform. I have noticed following two issues with the SDK:
====================================================
Functions which accept no input parameters
Some of the functions which accept no parameter when they are called. For example consider the function “void iotc_bsp_time_init ()”. This function has been declared as:
void iotc_bsp_time_init ();
but above declaration is ambiguous in C as it can be interpreted in any of following two ways:
in fact on some compiler it can result in following compile time error:
Error[Pa045]: function "iotc_bsp_time_init" has no prototype C:\data\mcd\Firmware\Middlewares\Third_Party\GCP\src\bsp\platform\B-L475E-IOT01A\iotc_bsp_time-b-l475e-iot0a.c 19
This error can be avoided using following change:
Edit corresponding .h/.c file which includes declaration and definition of this function and replace void iotc_bsp_time_init (); -> void iotc_bsp_time_init (void);
This issue is present for many other functions in "libiotc" directory.
==============================================================
some of the functions in .c files are not declared anywhere
functions like iotc_mqtt_logic_task_queue_shutdown() defined in file "libiotc\mqtt\logic\iotc_mqtt_logic_layer.c" are not declared anywhere. This can result in compile time warning message. This issue can be avoided by declaring this function in the beginning of this file. This issue is present with some other functions in this folder.
I propose to solve issue #1 and #2 mentioned above in my branch. Please review and accept my pull request.