CiscoDevNet / csmp-agent-lib

CiscoDevNet Opensource CSMP-Agent Library (OpenCSMP)
https://github.com/CiscoDevNet/csmp-agent-lib
Apache License 2.0
4 stars 3 forks source link

Inconsistency between function prototypes and implementation #3

Closed khues closed 1 year ago

khues commented 1 year ago

The commit "d42a3ea" in the GitHub project causes various segmentation faults because function implementations have been changed without changing the prototypes in the corresponding header file or the callers of these functions. If this code is executed, these function calls cause segmentation faults. Example: ProtobufVarint_encodeUINT32. The reason why GCC does not throw compiler warnings and errors in these cases is that the .c file that contain the function implementation does not include the .h file that contains the function prototype. Therefore, we would strongly suggest to always include the corresponding header file in the .c files so that such errors are detected early by GCC.

woobagooba commented 1 year ago

Resolved by PR f640f9b May 24 2023.