This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Putting C++ code into gcc front end


Richard Earnshaw wrote:

Could the C++ front end be modified to make it compilable with any C compiler (ignoring for the moment that parts of the C++ front end are now written in ISO c90). That is, how many gnu extensions are used, and can they be easily removed?
a quick compile with -pedantic shows,
char bitfields such as
1 cp-tree.h: unsigned char is_lang_type_class : 1;. Making this an int would
  enlarge that structure.
2 the tree checking stuff uses '({ ...})', but only when compiled with GCC
3 decl.c: (cond_expr) = value
  this hides inside things like 'current_binding_level = newlevel;'
4 some minor syntactic things that have crept in (extra ',', ';')

There is certainly intent to have it C89 compliant. Perhaps we should fix
those digressions correctly. #2 can be fixed with appropriate
__extension__ keywords. #3 is fixable by something like
	#define current_binding_level (*(cond ? &truething : &falsething)).
#4 is trivial. #1 may be more awkward without expanding the struct.

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]