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.
I have a .h file which is only intended to be included by C++ files. I've added the following protection: #ifndev __cplusplus #error Cannot be included into C sources! #endif The #error line is displayed in the editor as an error and there is no syntax highlighing below. Hmmm! It gets stranger! I added an obvious syntax error after the #error line to see if it would be recognized as a syntax error. Not only was it shown as an error, but the original syntax error on #error disappeared (the whole line went grey) and the rest of the file was correctly displayed with syntax highlighting. Once I removed the added error, the file was correctly displayed! (This is why I'm filing a P4 instead of a P2).
#ifndev __cplusplus ^ #ifndef ? is it just a misprint?
>> ifndev __cplusplus ... > is it just a misprint? Yes. The actual code has it right.
(In reply to comment #0) Some examples on how #error directive can be used is shown here: http://www.netrino.com/node/138 Personally I use it as a high priority TODO since the code doesn't compile until #error is removed. It should not be an indication to NetBeans: "Stop here, there is nothing of interest below this point" > I added an obvious syntax error after the #error line to see if it would > be recognized as a syntax error. Not only was it shown as an error, but > the original syntax error on #error disappeared (the whole line went grey) > and the rest of the file was correctly displayed with syntax highlighting. I can't repeat this behavior on my system NetBeans IDE 6.9.1 (Build 201007282301) on SUSE Linux Enterprise Desktop 11 (i586)