This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c/7425: deprecated attribute doesn't merge with multipledeclarations
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc at gcc dot gnu dot org, james at mail dot and dot org
- Date: Sat, 3 May 2003 17:07:14 +0100 (BST)
- Subject: Re: c/7425: deprecated attribute doesn't merge with multipledeclarations
- References: <87d6j0cito.fsf@student.uni-tuebingen.de>
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