aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2019-06-13 08:58:54 +0100
committerPedro Alves <palves@redhat.com>2019-06-13 08:58:54 +0100
commit66eb1ed3882aa3c54daa2fe24b7479b5ee0538f2 (patch)
treef38607b4d72c7ca1854215b597930a37c25b2bfb /gdb/compile
parente41d1c49a12aab7db33d7ad66d62f7413b8f0480 (diff)
downloadgdb-66eb1ed3882aa3c54daa2fe24b7479b5ee0538f2.zip
gdb-66eb1ed3882aa3c54daa2fe24b7479b5ee0538f2.tar.gz
gdb-66eb1ed3882aa3c54daa2fe24b7479b5ee0538f2.tar.bz2
Fix gdb build with -std=gnu++11
The options framework series broken the build with gcc 4.8, or any other compiler were we end up forcing -std=gnu++11, causing errors like these: ../../binutils-gdb/gdb/compile/compile.c: In function gdb::option::option_def_group make_compile_options_def_group(compile_options*): ../../binutils-gdb/gdb/compile/compile.c:266:44: error: could not convert (const gdb::option::option_def*)(& compile_command_option_defs) from const gdb::option::option_def* to gdb::array_view<const gdb::option::option_def> return {compile_command_option_defs, opts}; ^ CXX copying.o ../../binutils-gdb/gdb/compile/compile.c:267:1: error: control reaches end of non-void function [-Werror=return-type] } ^ This is a C++11 vs C++14 difference -- C++14 relaxed the rules for eliding braces. This commit fixes it by adding the missing (in C++11) braces. Tested with g++ 4.8. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * compile/compile.c (make_compile_options_def_group): Add braces around array_view initializer. * thread.c (make_thread_apply_all_options_def_group) (make_thread_apply_all_options_def_group): Likewise.
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index b467254..25d0bfe 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -263,7 +263,7 @@ static const gdb::option::option_def compile_command_option_defs[] = {
static gdb::option::option_def_group
make_compile_options_def_group (compile_options *opts)
{
- return {compile_command_option_defs, opts};
+ return {{compile_command_option_defs}, opts};
}
/* Handle the input from the 'compile file' command. The "compile