This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] libstdc++/66902 Make _S_debug_messages static.


On 26/08/15 21:22 +0100, Jonathan Wakely wrote:
This patch removes a public symbol from the .so, which is generally a
bad thing, but there should be no users of this anywhere (it's never
declared in any public header).

For targets using symbol versioning this isn't exported at all, as it
isn't in the linker script, so this really just makes other targets
consistent with the ones using versioned symbols.

Tested powerpc64le-linux and dragonfly-4.2, committed to trunk

commit d35fbf8937930554af62a7320806abecf7381175
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jul 17 10:15:03 2015 +0100

   libstdc++/66902 Make _S_debug_messages static.
PR libstdc++/66902
   	* src/c++11/debug.cc (_S_debug_messages): Give internal linkage.

diff --git a/libstdc++-v3/src/c++11/debug.cc b/libstdc++-v3/src/c++11/debug.cc
index 997c0f3..c435de7 100644
--- a/libstdc++-v3/src/c++11/debug.cc
+++ b/libstdc++-v3/src/c++11/debug.cc
@@ -103,7 +103,7 @@ namespace

namespace __gnu_debug
{
-  const char* _S_debug_messages[] =
+  static const char* _S_debug_messages[] =
  {
    // General Checks
    "function requires a valid iterator range [%1.name;, %2.name;)",


Jason suggested making the array const, which still gives it internal
linkage but prevents accidentally changing it, so even better.

Tested powerpc64le-linux, committed to trunk.


commit 370c0be6b4c82c0769b9808f7a7b378dc49a1a8a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 3 19:56:16 2015 +0100

    	PR libstdc++/66902
    	* src/c++11/debug.cc (_S_debug_messages): Make array const.

diff --git a/libstdc++-v3/src/c++11/debug.cc b/libstdc++-v3/src/c++11/debug.cc
index c435de7..ac3ac67 100644
--- a/libstdc++-v3/src/c++11/debug.cc
+++ b/libstdc++-v3/src/c++11/debug.cc
@@ -103,7 +103,7 @@ namespace
 
 namespace __gnu_debug
 {
-  static const char* _S_debug_messages[] =
+  const char* const _S_debug_messages[] =
   {
     // General Checks
     "function requires a valid iterator range [%1.name;, %2.name;)",

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]