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 215738 - preprocess body between '#ifdef'/#if defined '#endif' is parsed as comment
Summary: preprocess body between '#ifdef'/#if defined '#endif' is parsed as comment
Status: CLOSED WONTFIX
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-20 01:12 UTC by pzgyuanf
Modified: 2012-09-28 15:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (56.42 KB, text/plain)
2012-07-20 01:12 UTC, pzgyuanf
Details
the screenshot (19.08 KB, image/png)
2012-07-20 01:14 UTC, pzgyuanf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pzgyuanf 2012-07-20 01:12:06 UTC
Hi,
Don't know whether it is an issue or feature, 
the preprocess body between '#ifdef'/#if defined  '#endif' is parsed as comment.

You can see it paste the following codesnip into a *.c/h file:

#ifdef TRUE
#undef TRUE     /* the line we are discussing */
#endif


#if defined(__sun)
#include <sys/file.h>           /* Has definition of FASYNC */  /* the line we are discussing */
#endif


ENV
===
Product Version = NetBeans IDE 7.2 RC1 (Build 201206272359)
Operating System = Linux version 3.2.0-3-amd64 running on amd64
Java; VM; Vendor = 1.7.0_03
Runtime = OpenJDK 64-Bit Server VM 22.0-b10
Comment 1 pzgyuanf 2012-07-20 01:12:12 UTC
Created attachment 122198 [details]
IDE log
Comment 2 pzgyuanf 2012-07-20 01:14:04 UTC
the screenshot
Comment 3 pzgyuanf 2012-07-20 01:14:09 UTC
Created attachment 122199 [details]
the screenshot
Comment 4 Vladimir Voskresensky 2012-07-29 20:41:37 UTC
This is the feature. All "dead" preprocessor blocks are colored as "dead code".
It allows to see which part of code is treated as compiler's preprocessor as skipped.
Exact color can be configured in Tools->Options->Fonts&Colors.
Choose C/C++/Header languages and modify "Inactive Preprocessor Block" color if needed
Comment 5 pzgyuanf 2012-09-28 15:42:02 UTC
Sounds good, so I close it.

Thnaks,
Pprun