This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Get rid of -Wodr warning (PR build/23399)
On 2018-08-28 13:09, Tom Tromey wrote:
"Simon" == Simon Marchi <simon.marchi@polymtl.ca> writes:
Simon> The PR reports that building with -Wodr -flto complains about
different
Simon> versions of struct ipa_sym_addresses, in common/agent.c and
Simon> gdbserver/tracepoint.c. This patch renames the version in
common to
Simon> ipa_sym_addresses_common to avoid the name clash. Because the
IPA_SYM
Simon> assumed the name ipa_sym_addresses, it now requires the includer
to
Simon> define the IPA_SYM_STRUCT_NAME macro to define the name of the
structure
Simon> holding the IPA symbol addresses.
Simon> gdb/ChangeLog:
Simon> PR build/23399
Simon> * common/agent.c (IPA_SYM_STRUCT_NAME): Define.
Simon> (struct ipa_sym_addresses): Rename to...
Simon> (struct ipa_sym_addresses_common): ... this.
Simon> * common/agent.h (IPA_SYM): Use IPA_SYM_STRUCT_NAME.
Simon> gdb/gdbserver/ChangeLog:
Simon> PR build/23399
Simon> * tracepoint.c (IPA_SYM_STRUCT_NAME): Define.
Thanks for doing this. This seems a bit ugly but I didn't see any
obviously better way to go about it.
Indeed.
I was curious if we needed to add -Wodr to the build, but according to
the gcc manual it is enabled by default, so all is well.
Thanks, I pushed it.
Simon