This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] add __attribute__ ((designated_init))


On Mon, 20 Jan 2014, Tom Tromey wrote:

> I wrote a new test case covering the same cases that the sparse test
> case covers.  I also added tests for applying the attribute to
> non-struct types; note that in this case sparse issues a warning but
> gcc issues an error.  I think an error is more appropriate.

I think the test should also cover cases with designators such as .d.x = 
1.

> +static tree handle_designated_init (tree *, tree, tree, int, bool *);

handle_designated_init_attribute would seem a better name.

> +      error ("designated_init attribute is only valid on struct type");

%<designated_init%> (or use %qE with the attribute name as passed to the 
function, as is usual for such diagnostics).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]