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: Richard Earnshaw <rearnsha at arm dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, Richard dot Earnshaw at arm dot com, Rupert Wood <me at rupey dot net>, gcc at gcc dot gnu dot org
- Date: Tue, 04 Mar 2003 18:36:34 +0000
- Subject: Re: Putting C++ code into gcc front end
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
>
> On Tuesday, March 4, 2003, at 04:45 AM, Nathan Sidwell wrote:
> > 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 ',', ';')
>
> If you really want to be compliant, all external names have to be unique
> within 6 characters, case-insensitive (3.1.2). Somehow I doubt that's
> going to happen.
>
Here's something frightening:
nm -Pg cc1|awk '{ print $1 }'|sort|sed -e 's/^\(......\).*$/\1/'>/tmp/out
uniq /tmp/out > /tmp/out2
wc -l /tmp/out*
3771 /tmp/out
1449 /tmp/out2
ie more than 1/2 of global symbols in the cc1 compiler are not unique in
the first 6 characters.
R.