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



Ole said:

"Hm. You're saying that void pointer arithmetic is illegal in ISO C,
but some compilers allow it. Then you say that no compiler will
allow it in C++ because it is illegal. Logical?"

I completely agree with Ole's point.  I also think that
the lack of an ANSI/ISO standard has made C++ much less portable than C, but
this will change in the future, since the ISO C++ standard is coming out
soon.  Right now, I can't be sure that strictly ISO (proposed) standard C++
code will be portable to other compilers, since other compilers may not be
up-to-date on the standard.  If I write ISO standard C, I know it will be
portable.

To give a real world example, at my previous job (which I left 2 months ago)
at Boeing, I had to write programs for 4 different flavors of Unix
(including Linux), and porting C++ code was completely frustrating, because
the different compilers I had available to me supported different subsets of
C++.  I never had any trouble porting straight C code.

-----Original Message-----
From: Ole J. Tetlie [mailto:olet@ifi.uio.no]
Sent: Monday, October 19, 1998 10:31 AM
To: gtk-list@redhat.com
Subject: [gtk-list] Re: Was : Why is gtk+ written in C? - now : Quick
Rant


*-Paul Miller <Paul_Miller@avid.com>
|
| > 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.

Hm. You're saying that void pointer arithmetic is illegal in ISO C,
but some compilers allow it. Then you say that no compiler will
allow it in C++ because it is illegal. Logical?

| 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.

I concur.

--
The only way tcsh "rocks" is when the rocks are attached to its feet
in the deepest part of a very deep lake.             (Linus Torvalds)
olet@ifi.uio.no   [-: .elOle. :-]   olet@debian.org

--
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]