LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 2009 and C99 variadic macros

I've read in the help that "Variable arguments macro" (or variadic macro) is one of the C99 extensions supported in CVI 2009 (since CVI 8.5 if I' right).

So I declared the following variadic macro

#define ERR_MSG(x, ...)    printf(x, ##__VA_ARGS__)

using the ## token to swallow the preceding comma in case the variable-argument list is empty (the ## token is a GCC extension of C99, but also other compilers implement it).

 

Unfortunately CVI doesn't and I get a compiler error if I call

ERR_MSG("Message");

with an empty variable-argument list.

 

Would it be possible to implement the ## token also in CVI?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 1 of 2
(3,677 Views)

We'll try to implement this for a future release. Thanks for the feedback.

 

Mert A.

National Instruments

0 Kudos
Message 2 of 2
(3,667 Views)