public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix build with GCC 7.5
Date: Wed, 22 Nov 2023 15:27:54 +0100	[thread overview]
Message-ID: <4d6a5f51-eb17-4de4-9c9f-df6a487ee9a1@suse.de> (raw)
In-Reply-To: <20231122140310.861086-1-tromey@adacore.com>

On 11/22/23 15:03, Tom Tromey wrote:
> 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 this member not to be a
> bitfield.  It reduces the size of the enum a bit 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.
> 
> This patch does not change the size of struct field on 64-bit hosts.

Hi,

thanks for looking into this.

This fixes one of the three warnings.

But I still get:
...
/data/vries/gdb/src/gdb/gdbtypes.h:1616:49: error: 
‘fn_field::accessibility’ is too small to hold all values of ‘enum class 
accessibility’ [-Werror]
    ENUM_BITFIELD (accessibility) accessibility : 2;
                                                  ^
/data/vries/gdb/src/gdb/gdbtypes.h:1662:49: error: 
‘decl_field::accessibility’ is too small to hold all values of ‘enum 
class accessibility’ [-Werror]
    ENUM_BITFIELD (accessibility) accessibility : 2;
                                                  ^
...

Thanks,
- Tom

  reply	other threads:[~2023-11-22 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 14:03 Tom Tromey
2023-11-22 14:27 ` Tom de Vries [this message]
2023-11-22 15:17   ` Tom Tromey
2023-11-22 17:04     ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d6a5f51-eb17-4de4-9c9f-df6a487ee9a1@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).