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 134813 - Wrong macro processing
Summary: Wrong macro processing
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Leonid Lenyashin
URL:
Keywords:
Depends on: 120938
Blocks:
  Show dependency tree
 
Reported: 2008-05-10 22:32 UTC by crimcat
Modified: 2012-12-18 20:28 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 crimcat 2008-05-10 22:32:51 UTC
Test case:
1) Let's have 2 files - a header and a source file, for example, class1.h and class1.cc.
2) In the class1.h header put the following:
#ifndef _CLASS1_H
#define _CLASS1_H
/* <... put any class here, even dummy; just any valid code with valid highlighting in the editor...> */
#endif // _CLASS1_H
3) Put class implementation into the class1.cc:
#include "class1.h"
/* <...here goes the implementation, just any valid code...> */
4) Switch back to the class1.h in the IDE, observe that the source code highlighting is correct.
5) Switch back to the class1.cc in the IDE and add one more include preproc, like this:
#include "class1.h"
#include "class1.h"
/* <...previous content goes here...> */
6) Switch back to the class1.h in the IDE and see that all the text inside the macro-guard becomes grey (like
'disabled'); I mean in between #ifndef _CLASS1_H and #endif // _CLASS1_H

My comments.
Supposing that inside the compilation unit the macroses are kept alive to preserve consistency in the editor. This would
not be a problem. But, I guess, the header file is shown not as a single file but as a part of .cpp, so double include
enables that macro and text inside macro-guard becomes grey.
Comment 1 nnnnnk 2008-06-16 14:41:48 UTC
I can not reproduce this bug on my Solaris.

This issue duplicates IZ 120938 - ifndef/define macro in header renders its whole scope as grey (as in comment).
http://www.netbeans.org/issues/show_bug.cgi?id=120938
Comment 2 Alexander Simon 2008-06-23 16:33:43 UTC
Not repeatable.
It seems bug was fixed when IZ#120938 was fixed.