From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5557 invoked by alias); 31 Oct 2002 15:26:02 -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 5534 invoked by uid 71); 31 Oct 2002 15:26:02 -0000 Date: Thu, 31 Oct 2002 07:26:00 -0000 Message-ID: <20021031152602.5532.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: c++/7585: Attributes for nested typedef-name ignored Reply-To: Wolfgang Bangerth X-SW-Source: 2002-10/txt/msg01330.txt.bz2 List-Id: The following reply was made to PR c++/7585; it has been noted by GNATS. From: Wolfgang Bangerth To: Gabriel Dos Reis Cc: gcc-bugs@gcc.gnu.org, Subject: Re: c++/7585: Attributes for nested typedef-name ignored Date: Thu, 31 Oct 2002 09:21:27 -0600 (CST) > | I can see this as well, but I imagine the syntax is wrong: > | shouldn't it be > | typedef struct { } __attribute__((__aligned__(__alignof__(int)))) Y; > | > | instead of > | > | typedef struct { } Y __attribute__((__aligned__(__alignof__(int)))); > | > | ?? > > Maybe. But then, I think __alignof__(Y) should return > __alignof__(int) if the attribute is being applied to Y. > > Said differently, what do you envision for the "right" syntax for > > typedef unsigned char type[sizeof(int)] > __attribute__((__aligned__(__alignof__(int)))); I have no clue. I think that the weird C declaration syntax is probably just not suited for the application of attributes. And maybe it's simpler to understand if you make up the typedef in steps, say typedef unsigned char array[...] typedef aligne_array __attribute__(...) aligned_array; (or the attributes somewhere else). I think it would help to have a formal specification of attribute placement somewhere. Although it would probably be so complicated that nobody would want to read it... Regards Wolfgang ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth