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 - more support for variadic variables in macro
Summary: more support for variadic variables in macro
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 196216 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-02-16 13:48 UTC by Vladimir Voskresensky
Modified: 2011-05-22 08:52 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)