This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] Merge status
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: law at redhat dot com
- Cc: Ian Lance Taylor <ian at wasabisystems dot com>, Jason Merrill <jason at redhat dot com>, Diego Novillo <dnovillo at redhat dot com>, Paolo Bonzini <bonzini at gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 17 Mar 2004 11:01:02 +0000 (UTC)
- Subject: Re: [tree-ssa] Merge status
- References: <200403170457.i2H4v0YA003247@speedy.slc.redhat.com>
On Tue, 16 Mar 2004 email@example.com wrote:
> cast-as-lvalue is used all over the place. It's unfortunately become
> quite pervasive in C code. Somewhere around 10% of all the packages
> found in Fedora use the cast-as-lvalue extension in one way or another.
I thought that free software was generally designed to be portable, not
just to systems with GCC, and that glibc and the Linux kernel were
exceptions to the norm of portability; certainly GNU software tries to be
portable. (And Linux has rapidly been fixed, given Linus's opinion of
this extension as "braindamaged".)
(I suppose copying in the current version of obstack from gnulib, or in
similar cases disabling __GNUC__ conditionals to switch to the portable
non-GCC alternative, may be needed in some cases.)
(I also have the impression from past discussions on the GCC lists that
the new C++ parser in 3.4 breaks almost all C++ software by being stricter
without any deprecation period at all.)
> Removing cast-as-lvalue in some cases merely exchanges reasonably clean
> code for hideous code. Look at /usr/include/rpc/xdr.h for example.
So how were these casts-as-lvalues originally implemented by Sun for
non-GCC platforms? Surely not using __extension__ and GNU extensions.
Perhaps the fixinclude for obstack.h needs to be generalised to cover
other headers. The 3.4 manual defines what a cast-as-lvalue means, so
replacing with the expansion there (using __typeof__, in general, if the
type of a macro parameter isn't specified) should suffice. I certainly
hope these macros aren't specified to allow arguments with side effects.
Joseph S. Myers