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 254610 - error processing simple macro #define
Summary: error processing simple macro #define
Status: RESOLVED WORKSFORME
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Linux
: P2 normal with 1 vote (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-22 09:00 UTC by jaisondaniel
Modified: 2015-09-07 07:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
macro processing error (15.21 KB, image/png)
2015-08-22 09:00 UTC, jaisondaniel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jaisondaniel 2015-08-22 09:00:33 UTC
Created attachment 155545 [details]
macro processing error

macro is not processing correctly.

take the following piece of code in netbeans 8.1beta, not sure about other version.

-------------------------------------------------------------------
//#define ASIZE 6 // uncomment this to see the error in IDE
int ASIZE=6; // comment this to see the error in IDE

void printArray(int a[]) {
	for(int i=0; i<ASIZE; i++) {
		cout << a[i] << ", " << endl;
	}
}

int main(int argc, char** argv) {
	int a[] = { 12, 23, 34, 45, 56, 67, 78, 89 };
	printArray(a);
	return 0;
}
-------------------------------------------------------------------

No issue on compilation or running. even no issue in the IDE code processing. But the same code instead of variable if you use macro #define then you can see the code processing error "Unable to resolve identifier" for all the variables and the function which the function is using the macro variable.

-------------------------------------------------------------------
#define ASIZE 6 // uncomment this to see the error in IDE
//int ASIZE=6; // comment this to see the error in IDE

void printArray(int a[]) {
	for(int i=0; i<ASIZE; i++) {
		cout << a[i] << ", " << endl;
	}
}

int main(int argc, char** argv) {
	int a[] = { 12, 23, 34, 45, 56, 67, 78, 89 };
	printArray(a);
	return 0;
}
-------------------------------------------------------------------

Please see the attached screen-shot.
Comment 1 Alexander Simon 2015-09-03 08:48:34 UTC
Not reproducible in current development build.
Please verify the issue in the last development build.
Comment 2 jaisondaniel 2015-09-07 07:49:18 UTC
Thank You for the information. I cannot verify in the dev build. But Once the next release happen I will verify this issue on the released version atleast beta version but not the dev build.