From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56201 invoked by alias); 17 Jul 2015 02:18:56 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 55787 invoked by uid 48); 17 Jul 2015 02:18:52 -0000 From: "persgray at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/66902] New: _S_debug_messages is unneccessary public Date: Fri, 17 Jul 2015 02:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: persgray at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01483.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66902 Bug ID: 66902 Summary: _S_debug_messages is unneccessary public Product: gcc Version: unknown Status: UNCONFIRMED Severity: minor Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: persgray at gmail dot com Target Milestone: --- Created attachment 36000 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36000&action=edit proposed patch The _S_debug_messages array is defined in libstdc++-v3/src/c++11/debug.cc without "static" modifier, therefore becoming exported one. But it isn't used in GCC anywhere outside the debug.cc source module. I found no users installed in my laptop running many KDE-, GTK- and console-based programs. On the other side, size of _S_debug_messages differs in different versions of libstdc++. This way, while libstdc++ 4.9 is ABI-compatible with libstdc++ 4.2, this particular symbol causes warnings from ld.so (at least here on OpenBSD). Yes, libstdc++ versions are "mixed": some software requires decent versions of GCC and doesn't build on the base one (4.2.1); therefore, such software gets built and linked with GCC 4.9 (as of now), and libstdc++ 4.9 is forced to be searched for symbols before libstdc++ 4.2. This works in general, but there is a nasty warning produced: WARNING: symbol(_ZN11__gnu_debug17_S_debug_messagesE) size mismatch, relink your program This happens because _S_debug_messages contains different number of strings in different libstdc++ versions. Since there is no real reason to keep _S_debug_messages public, I propose making it static. There is an interface for accessing this array: const _Error_formatter& _Error_formatter::_M_message(_Debug_msg_id __id) const { return this->_M_message(_S_debug_messages[__id]); } So the lack of "static" keyword looks like a simple overlook problem. The attached patch simply adds "static" keyword. I've been running with this patch for many weeks without any problem on OpenBSD/amd64.