This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid _Rb_tree_rotate_[left,right] symbols export
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: François Dumont <frs dot dumont at gmail 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: Fri, 12 May 2017 12:03:42 +0100
- Subject: Re: Avoid _Rb_tree_rotate_[left,right] symbols export
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2247980C16
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2247980C16
- References: <bd5b8d85-6ee2-c7ed-8dfa-d24797a52d03@gmail.com>
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.