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 156567 - No error highlighting in preprocessor directive.
Summary: No error highlighting in preprocessor directive.
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-11 10:12 UTC by Alexander Simon
Modified: 2009-09-28 12:13 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2009-01-11 10:12:10 UTC
Code example:
--------------------
#define   FBC_CTL_FENCENO       (1<<0) #define FBC_COMMAND             0x0320c
#define   FBC_CMD_COMPRESS      (1<<0) #define FBC_STATUS              0x03210
--------------------
Expected:
- error highlighting in code.
Actual:
- Logger error:
SEVERE [org.netbeans.modules.cnd.apt]: line 33: # is not followed by a macro parameter
INCORRECT #define directive: in welcome.cc for:
        TOKEN{["#define   ",<13>,line=32,col=1],offset=1623,file=null}
MACRO{["FBC_CTL_FENCENO",<205>,line=32,col=11],offset=1633,file=null}BODY{["(",<138>,line=32,col=33],offset=1655,file=null
["1",<10>,line=32,col=34],offset=1656,file=null ["<<",<164>,line=32,col=35],offset=1657,file=null
["0",<9>,line=32,col=37],offset=1659,file=null [")",<139>,line=32,col=38],offset=1660,file=null
["#",<183>,line=32,col=40],offset=1662,file=null ["define",<205>,line=32,col=41],offset=1663,file=null}INCORRECT #define
directive: in welcome.cc for:
        TOKEN{["#define   ",<13>,line=33,col=1],offset=1702,file=null}
MACRO{["FBC_CMD_COMPRESS",<205>,line=33,col=11],offset=1712,file=null}BODY{["(",<138>,line=33,col=33],offset=1734,file=null
["1",<10>,line=33,col=34],offset=1735,file=null ["<<",<164>,line=33,col=35],offset=1736,file=null
["0",<9>,line=33,col=37],offset=1738,file=null [")",<139>,line=33,col=38],offset=1739,file=null
["#",<183>,line=33,col=40],offset=1741,file=null ["define",<205>,line=33,col=41],offset=1742,file=null}
Comment 1 nnnnnk 2009-04-17 15:06:33 UTC
Sunstudio and gnu preprocessors don't say anything about such macros.
So it's OK to have such code.
It's not an error, so it should not be highlighted.

The only problem appears if we use such macro in code.
But we highlight such usages as errors.