This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/64504] Invalid free() with _GLIBCXX_DEBUG and -fwhole-program
- From: "andrey.vihrov at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Jun 2015 15:12:19 +0000
- Subject: [Bug libstdc++/64504] Invalid free() with _GLIBCXX_DEBUG and -fwhole-program
- Auto-submitted: auto-generated
- References: <bug-64504-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64504
--- Comment #6 from Andrey Vihrov <andrey.vihrov at gmail dot com> ---
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.