Avoid _Rb_tree_rotate_[left,right] symbols export

Jonathan Wakely jwakely@redhat.com
Fri May 12 11:03:00 GMT 2017


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.

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
   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.



More information about the Libstdc++ mailing list