2.2.24rc1, 3.0.26rc1, 4.0.6rc1, 4.2.0beta1
Sprint 56 (Sep 2019), Sprint 55 (Aug 2019), Sprint 51 (Apr 2019), Sprint 54 (Jul 2019), Sprint 57 (Oct 2019), Sprint 58 (Nov 2019), Sprint 59 (Dec 2019), Sprint 60 (Jan 2020), Sprint 61 (Feb 2020), Sprint 62 (Mar 2020), Sprint 63 (Apr 2020), Sprint 64 (May 2020), Sprint 65 (Jun 2020), Sprint 66 (Jul 2020), Sprint 67 (Aug 2020)
Steps to reproduce:
- Download Zabbix sources or check out from repository
- Navigate to src/modules/dummy
- Comment out
- Try to build module: $ make
Tons of compilation errors.
This happens because module.h depends on zbxtypes.h, and zbxtypes.h in turn (implicitly!) depends on lots of system headers. So the only way to compile loadable module is to
But that's not the end of the story because sysinc.h includes system headers conditionally with conditional variables defined in another header(!!!) config.h which is generated by configure script. So one has to run $ ./configure before even attempting to build poor dummy module.
I think this is unacceptable. Module authors need to be quite creative to work around that and this puts extra stress on build systems and continuous integration. The only reason to
in module.h is definition of zbx_uint64_t:
My suggestion is to provide definition of zbx_uint64_t in module.h if it is used outside of Zabbix:
Since stdint.h is part of C99, this should cover most of use cases.
With explicit inclusion of necessary headers in dummy.c:
the module compiles cleanly requiring just module.h from Zabbix SVN or source tarball. Zabbix code compiles too.