From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90088 invoked by alias); 9 Jun 2015 15:12:26 -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 90017 invoked by uid 48); 9 Jun 2015 15:12:20 -0000 From: "andrey.vihrov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/64504] Invalid free() with _GLIBCXX_DEBUG and -fwhole-program Date: Tue, 09 Jun 2015 15:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andrey.vihrov 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: Message-ID: In-Reply-To: References: 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-06/txt/msg00831.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64504 --- Comment #6 from Andrey Vihrov --- Thanks for your reply. You have a point: using -fwhole-program introduces more effects than needed, as evidenced by this bug report, so an anonymous namespace is safer and cleaner. In any case, in this bug report we have a program that produces unexpected results with GCC. If this usage is supported, then it is a bug. If this usage is unsupported, then it would be nice to explicitly document cases when -fwhole-program can be used in GCC. For example, GCC documentation might say something like Note: -fwhole-program can be specified for programs that link only to the standard C/C++ library (or link to nothing at all), and do not use any template class or function from the standard C++ library.