This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Wrap locally used classes in anonymous namespace
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 22 Jun 2017 06:57:26 -0400
- Subject: [binutils-gdb] Wrap locally used classes in anonymous namespace
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT ffdbe8642e74527795b695988a176f0920d58f96 ***
Author: Yao Qi <yao.qi@linaro.org>
Branch: master
Commit: ffdbe8642e74527795b695988a176f0920d58f96
Wrap locally used classes in anonymous namespace
Both aarch64-tdep.c and arm-tdep.c defines a class instruction_reader, which
violates ODR, but linker doesn't an emit error. I fix this issue by wrapping
them by anonymous namespace, but I think it is better to apply this for all
locally used classes.
If it is a good idea to put locally used class into anonymous namespace, we
should document this rule into GDB coding convention, or even GCC coding
convention. Note that anonymous namespace has been used in GCC but GCC
coding convention doesn't mention the it.
gdb:
2017-03-22 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c: Wrap locally used classes in anonymous
namespace.
* arm-tdep.c: Likewise.
* linespec.c: Likewise.
* ui-out.c: Likewise.