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 76368 - parser failed on casting with "struct" keyword
Summary: parser failed on casting with "struct" keyword
Status: VERIFIED 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-15 12:57 UTC by Vladimir Voskresensky
Modified: 2008-01-25 20:44 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-15 12:57:24 UTC
Example struct_casting.cc:
#include <malloc.h>

static struct default_include {
  char *fname;			
  int cplusplus;		
  int cxx_aware;		
} include_defaults_array[]
  = {
    { 0, 1, 1 },
    { 0, 0, 0 }
    };
    
static struct default_include *include_defaults = include_defaults_array;

int main() {
      int num_dirs = 4;
      include_defaults
	= (struct default_include *) malloc ((num_dirs
					       * sizeof (default_include))
					      + sizeof (include_defaults_array));  
    return 1;
}

Failed in parser with messages:
Processing files:
struct_cast.cc]
struct_cast.cc:18:11: unexpected token: (
struct_cast.cc:18:36: unexpected token: )
struct_cast.cc:19:74: expecting SEMICOLON, found ')'
struct_cast.cc:20:80: expecting SEMICOLON, found ')'
Comment 1 Vladimir Voskresensky 2006-05-16 22:57:31 UTC
fixed in parser's grammar by updating rule cast_expression
Comment 2 akumta 2008-01-25 20:44:45 UTC
Verified with Netabeans6.0.