-
Problem report
-
Resolution: Fixed
-
Trivial
-
3.0.29rc1, 4.2.4rc1, 4.4.0alpha1
-
Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
-
0.125
Steps to reproduce:
Try to compile the following module code:
#include "sysinc.h" #include "module.h" int zbx_module_api_version(void) { return ZBX_MODULE_API_VERSION; } int zbx_module_init(void) { return ZBX_MODULE_OK; }
...with -Wmissing-prototypes option.
Result:
$ make gcc -Wmissing-prototypes -fPIC -shared -o dummiest.so dummiest.c -I../../../include dummiest.c:4:5: warning: no previous prototype for ‘zbx_module_api_version’ [-Wmissing-prototypes] int zbx_module_api_version(void) ^~~~~~~~~~~~~~~~~~~~~~ dummiest.c:9:5: warning: no previous prototype for ‘zbx_module_init’ [-Wmissing-prototypes] int zbx_module_init(void) ^~~~~~~~~~~~~~~
Expected:
No warnings when module source file defines functions with correct signatures. Warnings when module defines functions with wrong signatures. For this to happen module API functions should be declared in module.h header.