On Wed, 2005-06-08 at 11:11, Jani Monoses wrote:
> >>void pig(void) __attribute__ ((long_call));
> >>void pig(void)
> >>{
> >>}
> > 
> > Yes, that's the way it's currently coded.
> > 
> > The problem, it seems to me, is that we want to fault:
> > 
> >         void pig(void) __attribute__ ((long_call));
> >         ...
> >         void pig(void);
> >         
> > and
> > 
> >         void pig(void);
> >         ...
> >         void pig(void) __attribute__((long_call));
> >         
> > both of which would be potentially problematical (which do we believe?)
> > from the case that you have.  AFAICT there is nothing on the types
> > passed into the back-end to distinguish a declaration from a definition
> > in this context.
> 
> The cases you mention are two declarations right? 

Erm, yes (though I'd intended to write the second example as a
declaration followed by a definition).

> My example had the attribute on the 
> declaration and not on the definition just like with the other attribute 
> types.
> I suppose your explanation went way over my head, since I still don't 
> understand what is 
> different with the long-call attribute that the same approach which works 
> with other 
> function attributes yields an error in this case.
> Is there anything tricky that prevents an easy implementation?

Yes, internally the routine that's doing the comparison can't
distinguish declarations from definitions.  We need to diagnose
conflicting declarations, and also where the *definition* is attributed
but the declaration was not.

We could relax the rules to allow your case, but only at the expense of
losing checking for the above scenarios.  I'm not convinced that is a
good trade-off.

R.

Reply via email to