RE: [gtk-list] Re: Was : Why is gtk+ written in C? - now : Quick Rant



Perhaps the solution is to compile C code using a C++ compiler in C++ mode?
I.e egcs.

-----Original Message-----
From: paul@mail.redhat.com [mailto:paul@mail.redhat.com]On Behalf Of
Paul Miller
Sent: Monday, October 19, 1998 9:50 AM
To: gtk-list@redhat.com
Subject: [gtk-list] Re: Was : Why is gtk+ written in C? - now : Quick
Rant


> I think that the real issue is that C has been standardized for a long
> time,
> so that if you stick to ANSI C you can be reasonably sure that most
systems
> will
> be able to compile it, while the C++ standard has been

The main argument for C++ in my previous post was because of its
better-defined language and type-safety, it might avoid some problems
people are having (myself included) while attempting to compile packages
written in "ANSI" C. "ANSI" appears to be a nebulous term these days for
any code with "const" in it. Unfortunately, gcc lets way too many things
not "ANSI" slip by (like pointer arithmetic on void pointers). It's
impossible to do void pointer arithmetic in C++ (without an explicit
cast), no matter what compiler, because it is illegal.

The point wasn't merely so much about C++ being better for type-safety
(it is), but that "ANSI C" isn't nearly as "ANSI" as people think it is,
because compilers allow things like that to slip by.

If we all pay a bit more attention and turn all warnings and errors on,
we may yet get to the point where everyone can compile the code.

Cheers,

-Paul

--
Paul T. Miller                | paul@elastic.avid.com
Principal Engineer            | Opinions expressed here are my own.
Avid Technology, Inc. - Graphics and Effects Software Group

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]