#include header file to the generated file containing encvalue/decvalue
Submitted by Gyorgy Rethy
Link to original bug (#500334)
Description
Titan is supporting encvalue/decvalue for user-defined encode strings. It implicitly calls the related external function when an encvalue or decvalue function is met.
However, the generated C++ code will not compile.
Though the compiler knows the namespace and the name of the function (it calls it), it doesn't #include the .hh file of the module containing the relevant external function declaration to the .hh file where encvalue or decvalue is called. Hence the C++ compiler will not recognize the function call (namespace is not known).
The workaround is to include a TTCN-3 import into the module containing the encvalue and/or decvalue. However, because the names of the external functions are not used in the module, this is not a natural way to do at the TTCN-3 level.
This is an annoying kind of problem, because:
- the user gets an error during C++ compilation only; the cause of the problem may be unclear to him/her from the GCC error message.
- GCC stops compilation after the first C++ file containing an unknown namespace; therefore, when encvalue/decvalue (for types with user-defined encode strings) is used in several TTCN-3 modules, the workaround can be applied to each such module one-by-one only, and each step requires a C++ compilation, which takes a long time.
Version: 5.5.0