Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/build] Fix build breaker in language.c with gcc 7.5.0
@ 2022-08-05 15:18 Tom de Vries via Gdb-patches
  2022-08-05 15:30 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries via Gdb-patches @ 2022-08-05 15:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Hi,

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.

Any comments?

Thanks,
- Tom

[gdb/build] Fix build breaker in language.c with gcc 7.5.0

---
 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][gdb/build] Fix build breaker in language.c with gcc 7.5.0
  2022-08-05 15:18 [PATCH][gdb/build] Fix build breaker in language.c with gcc 7.5.0 Tom de Vries via Gdb-patches
@ 2022-08-05 15:30 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2022-08-05 15:30 UTC (permalink / raw)
  To: Tom de Vries via Gdb-patches; +Cc: Tom Tromey

Tom> This seems to be fixed by this change in the struct language_gdbarch
Tom> definition:
Tom> ...
Tom> -  struct language_arch_info arch_info[nr_languages] {};
Tom> +  struct language_arch_info arch_info[nr_languages];
Tom> ...

Tom> Tested on x86_64-linux.

Tom> Any comments?

Looks good, and it fixes the build, so please check it in.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-05 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 15:18 [PATCH][gdb/build] Fix build breaker in language.c with gcc 7.5.0 Tom de Vries via Gdb-patches
2022-08-05 15:30 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox