This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ extension "cast-as-lvalues": time to deprecate?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]