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
Karel Gardas writes:
> On Wed, 5 Mar 2003 tm_gccmail at mail dot kloo dot net wrote:
>
> > I personally think having parts of GCC written in C++ is a bad idea,
> > as it forces people to know Yet Another Language in addition to
> > C, shell scripts, sed, makefiles, etc.
> >
> > However, if this happens, you might consider looking at Mozilla's
> > C++ coding guidelines - they have experience with compiling with
> > many different C++ compilers on many different platforms.
> >
> > Here's the URL:
> >
> > http://www.mozilla.org/hacking/portable-cpp.html
>
> First five points on this list look quite restrictive:
>
> - Don't use C++ templates.
> - Don't use static constructors.
> - Don't use exceptions.
> - Don't use Run-time Type Information.
> - Don't use namespace facility.
And rather old-fashioned.
We are compiler writers. We are not ignorant users. We should know
which features are expensive, and which are not. We should know which
features make code easier to read, and which make it harder.
If we use templates, it is because we know why we are using them, and
it is the best way to solve the problem at hand.
If someone submits a patch that is inefficient or difficult to read,
that patch should be rejected. We already have mechanisms in place to
control this problem.
Trust the maintainers.
Andrew.