From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10828 invoked by alias); 3 May 2003 16:16:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10808 invoked by uid 71); 3 May 2003 16:16:01 -0000 Date: Sat, 03 May 2003 16:16:00 -0000 Message-ID: <20030503161601.10806.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: "Joseph S. Myers" Subject: Re: c/7425: deprecated attribute doesn't merge with multiple declarations Reply-To: "Joseph S. Myers" X-SW-Source: 2003-05/txt/msg00204.txt.bz2 List-Id: The following reply was made to PR c/7425; it has been noted by GNATS. From: "Joseph S. Myers" To: Falk Hueffner Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc@gcc.gnu.org, james@mail.and.org Subject: Re: c/7425: deprecated attribute doesn't merge with multiple declarations Date: Sat, 3 May 2003 17:07:14 +0100 (BST) 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