[ZBX-16239] module.h does not provide prototypes of module API functions Created: 2019 Jun 11  Updated: 2019 Jul 22  Resolved: 2019 Jul 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G), Proxy (P), Server (S)
Affects Version/s: 3.0.29rc1, 4.2.4rc1, 4.4.0alpha1
Fix Version/s: 4.0.11rc1, 4.2.5rc1, 4.4.0alpha1, 4.4 (plan)

Type: Problem report Priority: Trivial
Reporter: Glebs Ivanovskis Assignee: Viktors Tjarve
Resolution: Fixed Votes: 0
Labels: codequality, loadablemodule
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Team: Team A
Sprint: Sprint 53 (Jun 2019), Sprint 54 (Jul 2019)
Story Points: 0.125

 Description   

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.



 Comments   
Comment by Vladislavs Sokurenko [ 2019 Jun 13 ]

yes, warnings should be fixed, confirming

Comment by Viktors Tjarve [ 2019 Jul 09 ]

Releases in:

Generated at Fri Mar 29 18:02:28 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.