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 76430 - lexer failed in assert macro
Summary: lexer failed in assert macro
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-16 12:52 UTC by Vladimir Voskresensky
Modified: 2008-01-11 13:36 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 Vladimir Voskresensky 2006-05-16 12:52:38 UTC
Lexer failed on following example:
=========
#define _ASSERT_VOID_CAST(x) (void)(x)

#define likely(x) (x)
#define unlikely(x) (x)

void ddd_assert_fail (const char *assertion, const char *file,
		      unsigned int line, const char *function);


#define _assert_fn ""


#define assert(ex) \
_ASSERT_VOID_CAST(unlikely(ex) ? \
  0 : \
  (ddd_assert_fail (#ex, __FILE__, __LINE__, _assert_fn), 0) \
  )

void subtype_getweakref(int i, void *context)
{
	assert(1 + 3 <=
	       6);
}
=========

The main problem is absent of whitespace after "<=" if space after "<=" exists
=> no lexer exceptions.
Comment 1 Vladimir Voskresensky 2006-05-16 22:56:52 UTC
fixed in MacroExpander