This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/83536] One 'false' too much in r255699 for mingw target (in config/i386/i386.c)
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Dec 2017 18:41:29 +0000
- Subject: [Bug target/83536] One 'false' too much in r255699 for mingw target (in config/i386/i386.c)
- Auto-submitted: auto-generated
- References: <bug-83536-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83536
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
It's very error-prone to make these kinds of changes. Absent designated
initializers the problem could be avoided by defining an initialization macro
and using it to initialize the elements. E.g., something like this:
#define ATTR_SPEC_INIT(name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude) \
{ name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude }
With more than one such initialization macro new members could also be added
without having to disturb all those that don't need to set it to a non-default
value. E.g.,
#define ATTR_SPEC_DECL_INIT(name) \
ATTR_SPEC_INIT (name, 0, 0, true, false, false, false, NULL, NULL }
#define ATTR_SPEC_TYPE_INIT(name) \
ATTR_SPEC_INIT (name, 0, 0, false, true false, false, NULL, NULL }
etc.
Another alternative is to move the tables into their own files compiled using
the C compiler and make use of designated initializers.