This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] add __attribute__ ((designated_init))
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 23 Jan 2014 17:58:53 +0000
- Subject: Re: [PATCH] add __attribute__ ((designated_init))
- Authentication-results: sourceware.org; auth=none
- References: <874n4ygzay dot fsf at fleche dot redhat dot com>
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