This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 195560

Summary: more support for variadic variables in macro
Product: cnd Reporter: Vladimir Voskresensky <vv159170>
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: RESOLVED FIXED    
Severity: normal CC: alexvsimon
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Vladimir Voskresensky 2011-02-16 13:48:07 UTC
http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html
describes a syntax like 
#define eprintf(format, ...) fprintf (stderr, format, ##__VA_ARGS__)
which has special interpretation of suppressing comma when input list is empty
+ named variadics
#define eprintf(args...) fprintf (stderr, args)

which we do not support
Comment 1 Vladimir Voskresensky 2011-03-03 10:38:40 UTC
*** Bug 196216 has been marked as a duplicate of this bug. ***
Comment 2 Vladimir Voskresensky 2011-03-03 10:39:08 UTC
Code example:
---------------8<--------------------
#define LOG(args...) fprintf(stderr, ## args)
int foo(char * env_map, char * env_log) {
    LOG("\n>>>NBBUILD: TOOLS=%s\n\tLOG=%s\n", env_map, env_log);
}
---------------8<--------------------
Actual expansion is:

int foo(char * env_map, char * env_log) {
    fprintf(stderr ,"\n>>>NBBUILD: TOOLS=%s\n\tLOG=%s\n" );
}

Expected expansion is:

int foo(char * env_map, char * env_log) {
    fprintf(stderr ,"\n>>>NBBUILD: TOOLS=%s\n\tLOG=%s\n", env_map, env_log);
}
Comment 3 Vladimir Voskresensky 2011-03-03 10:40:02 UTC
I will have a look, not sure about P2 status
Comment 4 Vladimir Voskresensky 2011-05-20 23:16:58 UTC
http://hg.netbeans.org/releases?cmd=changeset;node=03356b37017e
Comment 5 Quality Engineering 2011-05-22 08:52:06 UTC
Integrated into 'main-golden', will be available in build *201105220400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6f4f03d20303
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixed #195560 - more support for variadic variables in macro
- support named variadic macro parameters
(transplanted from 03356b37017e72f854f9d1b18162d9200c05e076)