Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
2.2
-
None
-
Linux CentOS 7.4
Description
The includefile include/maxscale/json_api.h in turn includes the file include/maxscale/cppdefs.hh. The issue is that the former is a C-file, both indicated by it's name as well as the content of the file. The latter though is a C++ file. This means that although the functions in json_api.h, which a valid C functions, cannot be used in a C-modeul as the latter includefile is a C++ file and hence insists on C++ code. In general it is bad practice to include a C++ include file in another include file that is distinctly C (including C in a C++ include file is perfectly OK though). In practice this limits someone who is writing a module in C to use the functions defined in json_api.h, despite that these are perfectly valid C functions. testing by removing the inclusion of cppdefs.hh from json_api.h shows that this is not really necessary, everything compiles fine even without json_api.h including cppdefs.hh.