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: [Patch] Add "unavailable" attribute [ObjC V1 prerequisite].


On Fri, 16 Apr 2010, IainS wrote:

> 
> On 16 Apr 2010, at 20:04, Joseph S. Myers wrote:
> 
> > On Fri, 16 Apr 2010, IainS wrote:
> > 
> > > As noted above, the semantics of this are identical to those of the
> > > deprecation attribute (one would expect them to be applied to the same
> > > positions in source code).  I have also borrowed heavily from the
> > > deprecation
> > > implementation.
> > 
> > I don't like duplicating all the infrastructure like this.  It would seem
> > better to me to expand TREE_DEPRECATED to more than one bit to allow
> > different levels of deprecation to be represented without duplicating a
> > load of code.
> 
> This might be marginal since the main actual duplication is in "handle_xxxx"
> and the
> top level section which either prints warning or error.
> 
> I thought about parameterizing these routines whilst doing this, and came to
> the conclusion that it wouldn't save a lot.
> However, of course, I will give it some more thought.

There also seems to be a lot of duplication of code that looks up first 
one attribute then another; that should be refactored to have a single 
function that takes an attribute list and returns the deprecation level.

-- 
Joseph S. Myers
joseph@codesourcery.com


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