Attempts to instrument source code that includes "stdarg.h" with IBM Rational Test RealTime result in "error #20".
You see the following error.
attolccp: "/home/Rational/releases/examples/BaseStation_C/src/UmtsServer.cpp", line 17: error #20: identifier "__builtin_stdarg_start" is undefined __builtin_stdarg_start((arg_list),goober);
attolccp: "/home/Rational/releases/examples/BaseStation_C/src/UmtsServer.cpp", line 18: error #20: identifier "__builtin_va_end" is undefined
__builtin_va_end( arg_list );
attolccp - FATAL ERROR: Syntax and/or semantic errors in source file, instrumentation cancelled
Recent versions of GNU (after 2.95) have introduced new keywords for the GNU compiler, for example __builtin_va_end, These keywords point to the fact that these function are built into the compiler.
Resolving the problem
For the Test RealTime instrumentor to accept these built-in types, you must declare these.
static xxx( int goober, ... )
va_start( arg_list, goober );
va_end( arg_list );
To pre-declare these built-in types, add the following lines of code to the TDP in the TDP Editor.
- Start the TDP Editor.
- Open the TDP you are using with "File -> Open"
- Add the following to
Parser Settings > Component Testing for C++ ... > Header file configuration.
#define __builtin_va_arg(a,p) 0