This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ extension "cast-as-lvalues": time to deprecate?
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 9 May 2003 14:06:44 +1000
- Subject: Re: C++ extension "cast-as-lvalues": time to deprecate?
- References: <3b6301c315bd$194a7c60$114e2697@bagio>
On 09-May-2003, Giovanni Bajo <giovannibajo@libero.it> wrote:
> GCC implements an extension which lets cast result be a lvalue instead of a
> rvalue, as would be prescribed by the standard. There are several open PRs
> about problems with this extension, some of which are very tricky and
> involves also wrong-code problems (together with inliner, for instance).
> Just for reference, you may want to check:
>
> http://gcc.gnu.org/PR?1833
> http://gcc.gnu.org/PR?1920
> http://gcc.gnu.org/PR?7503
> http://gcc.gnu.org/PR?7884
>
> Other PRs have been closed already as duplicates.
>
> I think there are no doubts that this extension causes confusion among
> users, because the behaviour is not expected. Plus, bugs in its
> implementation causes very bad side effects. If this was not enough, the
> extension is active even in -ansi -pedantic mode, which is counter intuive
> and confusing. Since GCC already deprecated and removed less evil extensions
> like implicit typename, I wonder if maybe it's time to deprecate this
> "cast-as-lvalue" and remove it as soon as possible.
Are you suggesting just deprecating it just in C++, or also in C?
I would prefer that it not be deprecated.
The reason is that this is a useful extension in C
(especially in conjunction with global register variables),
and I would prefer that GNU C++ support anything that GNU C supports,
since GNU C constructs may get used in C header files which are
included in C++ programs.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.