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 134614 - Find Usages don't find macros that are concatenated (using #) from other macros
Summary: Find Usages don't find macros that are concatenated (using #) from other macros
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-06 15:03 UTC by Vladimir Kvashin
Modified: 2010-10-27 13:30 UTC (History)
0 users

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 Kvashin 2008-05-06 15:03:18 UTC
Find Usages can not find macros that are concatenated (via # operator) from other macros
See the example below. There are two usages of the MINMAX macro in the code.
But only 1-st one is found.

#define MIN(a, b) ((a < b) ? (a) : (b))
#define MAX(a, b) ((a > b) ? (a) : (b))
#define MINMAX(a, b) MIN(a, b) + MAX(a, b)
#define MERGE(a, b, c, d) a##b(c, d)

void foo() {
    int i = MINMAX(1, 2); // MINMAX is found here
    int j = MERGE(MIN, MAX, 3, 4); // but MINMAX wasn't found here!
}
Comment 1 Vladimir Kvashin 2008-05-06 15:07:15 UTC
There is another issue, which, I believe is tightly connected (if not, please file another issue).
In the same example, MIN is found in the line 
    int j = MERGE(MIN, MAX, 3, 4);
But there is no usage of MIN there.
Comment 2 Alexander Pepin 2010-10-27 13:30:42 UTC
It's not targeted to the current release.