Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV variadic macro not standard compliant

Hi,

i just tried to compile OpenCV 2.4.2 with Oracle Studio 12 under Solaris 10 x86, but i get the following error:

... ".../OpenCV-2.4.2/modules/ts/src/ts_perf.cpp", line 115: Warning: Too few arguments in macro LOGE. ".../OpenCV-2.4.2/modules/ts/src/ts_perf.cpp", line 115: Error: Trailing comma in a parameter list. ...

As i found out LOGE is defined in modules/ts/include/opencv2/ts/ts_perf.hpp as

define LOGE(_str, ...) do{printf(_str , ## __VA_ARGS__); printf("\n");fflush(stdout);} while(0)

Here, a gcc extension ("##" - the meaning is explained in the documentation link:here. It is as an extension provided by gcc. But it is a serious problem for other compilers, because it's not standard compliant.

A detailed discussion can be found here: link:thread at stackoverflow

Any help how to solve this issue?

Thanks

Julian