public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/build] Fix build breaker in language.c with gcc 7.5.0
Date: Fri,  5 Aug 2022 15:31:49 +0000 (GMT)	[thread overview]
Message-ID: <20220805153149.0542338582A3@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=99c902690493e35aad16b2083bad34cf79c366bf

commit 99c902690493e35aad16b2083bad34cf79c366bf
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Aug 5 17:31:43 2022 +0200

    [gdb/build] Fix build breaker in language.c with gcc 7.5.0
    
    When building gdb on openSUSE Leap 15.3, using gcc 7.5.0, I run into:
    ...
    gdb/language.c: In constructor ‘constexpr language_gdbarch::language_gdbarch()’:
    gdb/language.c:921:8: error: use of deleted function \
      ‘language_arch_info::language_arch_info(const language_arch_info&)’
     struct language_gdbarch
            ^~~~~~~~~~~~~~~~
    In file included from gdbsupport/common-defs.h:104:0,
                     from gdb/defs.h:28,
                     from gdb/language.c:31:
    gdb/language.h:95:28: note: declared here
       DISABLE_COPY_AND_ASSIGN (language_arch_info);
                                ^
    include/ansidecl.h:342:3: note: in definition of macro \
      ‘DISABLE_COPY_AND_ASSIGN’
       TYPE (const TYPE&) = delete;   \
       ^~~~
    gdb/language.c: In function ‘language_gdbarch* get_language_gdbarch(gdbarch*)’:
    gdb/language.c:936:22: note: synthesized method ‘constexpr \
      language_gdbarch::language_gdbarch()’ first required here
           l = new struct language_gdbarch;
                          ^~~~~~~~~~~~~~~~
    ...
    
    This seems to be fixed by this change in the struct language_gdbarch
    definition:
    ...
    -  struct language_arch_info arch_info[nr_languages] {};
    +  struct language_arch_info arch_info[nr_languages];
    ...
    
    Tested on x86_64-linux.

Diff:
---
 gdb/language.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/language.c b/gdb/language.c
index c185a009a72..bc784a8ec79 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -922,7 +922,7 @@ struct language_gdbarch
 {
   /* A vector of per-language per-architecture info.  Indexed by "enum
      language".  */
-  struct language_arch_info arch_info[nr_languages] {};
+  struct language_arch_info arch_info[nr_languages];
 };
 
 static const registry<gdbarch>::key<language_gdbarch> language_gdbarch_data;


                 reply	other threads:[~2022-08-05 15:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220805153149.0542338582A3@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /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).