This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Avoid _Rb_tree_rotate_[left,right] symbols export
- From: François Dumont <frs dot dumont at gmail dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 14 May 2017 22:37:04 +0200
- Subject: Re: Avoid _Rb_tree_rotate_[left,right] symbols export
- Authentication-results: sourceware.org; auth=none
- References: <bd5b8d85-6ee2-c7ed-8dfa-d24797a52d03@gmail.com> <20170512110342.GY5109@redhat.com>
On 12/05/2017 13:03, Jonathan Wakely wrote:
On 11/05/17 22:06 +0200, François Dumont wrote:
Hi
When versioned namespace is active we can avoid export of
_Rb_tree_rotate_[left,right] symbols. I also took the opportunity to
put static functions in the anonymous namespace rather than using
static. Is this usage of static still planned to be deprecated ?
No, I don't think so.
So not interested in replacing it with anonymous namespace ?
A much simpler (but equivalent) change would be:
--- a/libstdc++-v3/src/c++98/tree.cc
+++ b/libstdc++-v3/src/c++98/tree.cc
@@ -153,6 +153,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/* Static keyword was missing on _Rb_tree_rotate_left.
Export the symbol for backward compatibility until
next ABI change. */
+#if _GLIBCXX_INLINE_VERSION
+ static
+#endif
Surely simpler but why keeping this function if it is not used ?
void
_Rb_tree_rotate_left(_Rb_tree_node_base* const __x,
_Rb_tree_node_base*& __root)
@@ -184,6 +187,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/* Static keyword was missing on _Rb_tree_rotate_right
Export the symbol for backward compatibility until
next ABI change. */
+#if _GLIBCXX_INLINE_VERSION
+ static
+#endif
void
_Rb_tree_rotate_right(_Rb_tree_node_base* const __x,
_Rb_tree_node_base*& __root)
* src/c++98/tree.cc [_GLIBCXX_INLINE_VERSION]
(_Rb_tree_rotate_left, _Rb_tree_rotate_right): Remove.
* src/c++98/tree.cc (local_Rb_tree_increment,
local_Rb_tree_decrement):
Move to anonymous namespace.
(local_Rb_tree_rotate_left, local_Rb_tree_rotate_right): Likewise.
Tested under Linux x86_64 with versioned namespace.
What about the normal configuration? It's much more important that the
default configuration works. The versioned namespace that nobody uses
doesn't matter.
Normal mode now tested too, success.
François