This is the mail archive of the gcc-bugs@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]

[Bug target/83536] One 'false' too much in r255699 for mingw target (in config/i386/i386.c)


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.

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