[committed][gdbserver] Fix Wlto-type-mismatch for debug_agent
Christian Biesinger
cbiesinger@google.com
Fri Jun 12 18:19:11 GMT 2020
On Fri, Jun 12, 2020 at 11:37 AM Tom de Vries <tdevries@suse.de> wrote:
>
> Hi,
>
> When building gdb including gdbserver with CFLAGS/CXXFLAGS -O2 -g -flto=auto,
> I run into:
> ...
> src/gdbserver/../gdbsupport/agent.h:47:13: error: type of 'debug_agent' \
> does not match original declaration [-Werror=lto-type-mismatch]
> extern bool debug_agent;
> ^
> src/gdbserver/ax.cc:28:5: note: type 'int' should match type 'bool'
> int debug_agent = 0;
> ^
> src/gdbserver/ax.cc:28:5: note: 'debug_agent' was previously declared here
> src/gdbserver/ax.cc:28:5: note: code may be misoptimized unless \
> -fno-strict-aliasing is used
So it sounds like this didn't come up before because ax.cc doesn't
include gdbsupport/agent.h? It probably should?
Christian
More information about the Gdb-patches
mailing list