]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix build with GCC 7.5
authorTom Tromey <tromey@adacore.com>
Wed, 22 Nov 2023 13:54:40 +0000 (06:54 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 23 Nov 2023 04:20:37 +0000 (21:20 -0700)
commita54a99a6e5159e4406e172f074b3729b2135c28c
tree6b452fc57b84efd0370dbfc71bb3b7906aef0e70
parentd95ba7227e2185ed83e5d62975f2ca76f445146c
Fix build with GCC 7.5

A recent change to 'struct field' caused a build failure with GCC
7.5.0, as reported by Tom de Vries:

/data/vries/gdb/src/gdb/gdbtypes.h:721:51: error:
‘field::m_accessibility’ is too small to hold all values of ‘enum
class accessibility’ [-Werror]
   ENUM_BITFIELD (accessibility) m_accessibility : 2;
                                                   ^

Mark Wielaard pointed out that this was a GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242

This patch works around the bug by changing several members not to be
bitfields.  It reduces the size of the enum's underlying type,
instead.

I also changed m_bitsize to no longer be a bitfield -- that was done
for packing reasons in ancient times, but with m_accessibility not
being a bitfield, this no longer matters.

I removed fn_field::dummy.  In earlier times it was somewhat normal in
gdb to have these dummy fields to keep track of any available padding.
However, since the advent of "ptype/o", there doesn't seem to be any
need for this.

This patch does not change the size of struct field, fn_field, or
decl_field on 64-bit hosts.
gdb/gdbtypes.h