This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] gdb: unconditionally define _initialize_string_view_selftests
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Sergei Trofimovich <slyfox at gentoo dot org>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tom at tromey dot com>
- Date: Mon, 18 Mar 2019 00:02:26 -0400
- Subject: Re: [PATCH v2] gdb: unconditionally define _initialize_string_view_selftests
- References: <20190317222004.0afa508d@sf> <20190317222731.11704-1-slyfox@gentoo.org>
On Sunday, March 17 2019, Sergei Trofimovich wrote:
> From: Sergei Trofimovich <siarheit@google.com>
>
> The build failure was noticed by Helmut Jarausch in
> https://bugs.gentoo.org/680232:
> $ ./configure CXXFLAGS='-std=c++17 -Os'
> ...
> CXXLD gdb
> ld: init.o: in function `initialize_all_files()':
> init.c:(.text+0x113): undefined reference to `_initialize_string_view_selftests()'
>
> It happens because '_initialize_string_view_selftests()' is
> conditionally defined based on C++ default.
>
> The change defines '_initialize_string_view_selftests()'
> unconditionally and leaves implementation a no-op on c++17
> compilers.
> ---
> gdb/ChangeLog | 6 ++++++
> gdb/unittests/string_view-selftests.c | 6 ++++--
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index 862c89e821..7684d9be60 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,9 @@
> +2019-03-17 Sergei Trofimovich <siarheit@google.com>
> +
> + * unittests/string_view-selftests.c: define
Uppercase "D" on "Define".
> + _initialize_string_view_selftests unconditionally. This
> + fixes build failure on CXXFLAGS="-std=c++17" setup.
FWIW, a ChangeLog entry should mention *what* changed, not *why*. So
something like:
2019-03-17 Sergei Trofimovich <siarheit@google.com>
* unittests/string_view-selftests.c: Define
_initialize_string_view_selftests unconditionally.
is fine.
Since Tom has already approved the patch, I went ahead and checked it
in:
58785d9888c699770154ef1d42fcea7598e8d704
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/