This is the mail archive of the gcc-patches@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: [lto] PATCH: Add support for referencing types from function bodies


> Then why did RTH keep on telling Kenner to use CONST_DECLs for the same
> reason why the Objective-C uses them, to take an ADDR_EXPR of them for
> CONSTRUCTORs?
> 
> http://gcc.gnu.org/ml/gcc/2004-08/msg01021.html

I read that as saying "don't take the address of a CONSTRUCTOR", not "use
CONST_DECL"!  Indeed he said "CONST_DECL or VAR_DECL".

I think the semantics of CONST_DECL have always been a bit peculiar.  The
most common usage was for enumeral names, but there has been an increasing
trend in recent years to use them as if they were equivalent to a readonly
VAR_DECL.  I was one of those people.  But I think that was wrong and the
primary reason it was wrong is that it's now hard to say what the
*difference* between a CONST_DECL and readonly VAR_DECL is: there shouldn't
be two different ways of saying the same thing.

So I now support going back to viewing CONST_DECL as nothing more than the
name of a constant.


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