c/7425: deprecated attribute doesn't merge with multiple declarations
Joseph S. Myers
jsm28@cam.ac.uk
Sat May 3 16:07:00 GMT 2003
On Sat, 3 May 2003, Falk Hueffner wrote:
> I'm not sure what is supposed to happen with multiple declarations
> with conflicting attributes, I cannot find anything in the manual
> about this. Do we really want to "merge" them? What should happen if
> they conflict? Other options seem to be "choose any" and "choose the
> later". Current behaviour seems to be "choose any".
Multiple attribute lists should be merged; if in any case they aren't,
this is a bug. Where attributes have some effect on the type or the decl
beyond simply adding to the attribute list, there may need to be specific
code to handle that merging. If they conflict (which in this case they
don't), this should be a hard error. E.g., conflicting i386 regparm
attributes ought to generate a hard error (there was a Linux kernel was
with such conflicting attributes, which was noticed when a new GCC version
changed which of the two conflicting regparm attributes was used; but GCC
ought to detect that sort of thing). Targets need to define
TARGET_COMP_ATTRIBUTES, TARGET_MERGE_{TYPE,DECL}_ATTRIBUTES if there are
any conflicting target attributes.
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc
mailing list