This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Putting C++ code into gcc front end
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Richard dot Earnshaw at arm dot com
- Cc: Rupert Wood <me at rupey dot net>, gcc at gcc dot gnu dot org
- Date: Tue, 04 Mar 2003 12:45:44 +0000
- Subject: Re: Putting C++ code into gcc front end
- Organization: Codesourcery LLC
- References: <200303041142.h24Bg0K28784@pc960.cambridge.arm.com>
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