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.
Preprocessor do not match if-endif in following example taken from Open Solaris: #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) # define OS_CODE 0x00 # if defined(__TURBOC__) || defined(__BORLANDC__) # if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) /* Allow compilation with ANSI keywords only enabled */ void _Cdecl farfree( void *block ); void *_Cdecl farmalloc( unsigned long nbytes ); # else # include <alloc.h> # endif # else /* MSC or DJGPP */ # include <malloc.h> # endif #endif
Simplified test case: #if(defined(_MSC_VER)) int a; #endif
the problem with "(" without space after #if
fixed in trunk: - handle start comment and line continuation after preprocessor directives - handle LPAREN after #if* preprocessor directives cvs log: Checking in aptlexer.g; /shared/data/ccvs/repository/cnd/apt/src/org/netbeans/modules/cnd/apt/impl/support/aptlexer.g,v <-- aptlexer.g new revision: 1.16; previous revision: 1.15 done
Created attachment 53130 [details] proposed patch for release60
tests: Checking in data/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc; /shared/data/ccvs/repository/cnd/modelimpl/test/unit/data/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc,v <-- lparenAfterPPKwds.cc initial revision: 1.1 done RCS file: /shared/data/ccvs/repository/cnd/modelimpl/test/unit/data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.dat,v done Checking in data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.dat; /shared/data/ccvs/repository/cnd/modelimpl/test/unit/data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.dat,v <-- lparenAfterPPKwds.cc.dat initial revision: 1.1 done RCS file: /shared/data/ccvs/repository/cnd/modelimpl/test/unit/data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.err,v done Checking in data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.err; /shared/data/ccvs/repository/cnd/modelimpl/test/unit/data/goldenfiles/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest/lparenAfterPPKwds.cc.err,v <-- lparenAfterPPKwds.cc.err initial revision: 1.1 done Checking in src/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest.java; /shared/data/ccvs/repository/cnd/modelimpl/test/unit/src/org/netbeans/modules/cnd/modelimpl/trace/FileModelTest.java,v <-- FileModelTest.java new revision: 1.23; previous revision: 1.22 done
Following HR process ...
I reviewed the attached fix. I think it's correct and safe. The lexer grammar is fixed via quite an easy and safe way.
Changing back to P1 (it was occasionally changed to P2)
verified in the trunk build 20071118
fix integrated into release60: Checking in aptlexer.g; /shared/data/ccvs/repository/cnd/apt/src/org/netbeans/modules/cnd/apt/impl/support/aptlexer.g,v <-- aptlexer.g new revision: 1.15.2.1; previous revision: 1.15 done
verified in RC2 build (200711201000)