OSDN: Open Source Development NetworkNewsletters - Jobs  SEARCH:   

Counter

Logged In: tim_littlefair
Logout  
Register New Project  
Account Maintenance  

Change My Theme  
My Personal Page  

Bookmark this page  

Search

Require All Words


Project: C and C++ Code Counter
Project Summary  

Project Admin  

Software
Software Map  
New Releases  
Other Site Mirrors  
Code Snippet Library  

SourceForge.net
Site Docs  
Work for Sourceforge!  
Discussion Forums  
Project Help Wanted  
Top Projects  
Site Status  
Contact Support  

jobs.osdn.com  

Compile Farm  

Contact SourceForge.net  
About SourceForge.net  

SourceForge.net Foundries
About Foundries  

Clustering  
Distributed Computing  
Linux on Large Systems  
Linux Kernel  
Linux Drivers  
3D  
Games  
Java  
Printing  
Storage  

 
Project: C and C++ Code Counter

Trackers


Summary |  Admin |  Home Page |  Forums |  Tracker |  Bugs |  Support |  Lists |  Tasks |  News |  Files | 

Submit New | Browse | Reporting | Admin

[ #233587 ] Does not handle negative numbers in member initializers

 (?)
Submitted By:
Victor B. Putz (vputz)
Date Submitted:
2001-02-22 13:14
Data Type: (?)
Category: (?)
 (admin)
Group: (?)
 (admin)
Assigned To: (?)
 (admin)
Priority: (?)
Status: (?)
Resolution: (?)
Summary: (?)
C++ code parser does not handle negative numbers in member initialization lists. The following code compiles correctly under gcc but cannot be parsed correctly by cccc:

test.cpp
class c
{
int a;
c( void ) :
e( -1 ) {};
};


cccc generates the following:

Parsing
Processing test.cpp as C/C++ (c++.ansi)
test.cpp(4): syntax error at token c
Parser context:
test.cpp(4): trying to match class_block_item_list at 'c
test.cpp(3): trying to match class_block_item_list at 'int
test.cpp(2): trying to match class_block at '{
test.cpp(2): trying to match class_suffix at '{
test.cpp(1): trying to match class_declaration_or_definition at 'class
test.cpp(1): trying to match definition_or_declaration at 'class
test.cpp(1): trying to match link_item at 'class
test.cpp(1): trying to match start at 'class

test.cpp(6): syntax error at token }
Parser context:
test.cpp(6): trying to match start at '}
test.cpp(1): trying to match start at 'class



Changing the "-1" in the example above to a "1" will not generate an error. Enclosing the "-1" in parentheses will also not generate an error.

-->VPutz
Use Canned Response: (?)
 (admin)

OR Attach A Comment: (?)

Followups:

No Followups Have Been Posted

Check to Upload & Attach File: (?)

File Description:

Existing Files:

Delete Name Description Download
No Files Currently Attached

Change Log:

No Changes Have Been Made to This Item

 

 

Show Source