This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/60958] Initialization of arrays in tr1/regex ill-formed or with undefined behaviour
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Apr 2014 15:42:08 +0000
- Subject: [Bug libstdc++/60958] Initialization of arrays in tr1/regex ill-formed or with undefined behaviour
- Auto-submitted: auto-generated
- References: <bug-60958-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60958
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Hubert Tong from comment #2)
> I am trying to use a code base which used a TR1 regex implementation on
> another platform. Your comment led me to find
> http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#status.iso.tr1,
> which does indicate that tr1/regex does not work.
It's incomplet and incorrekt. Even with those array initializers fixed that
function tries to call a non-existent std::ctype::isspace() function and does
(__f | __wt) when it should be (__f & __wt), and only works for char not
wchar_t, and probably other issues.
> Is the recommendation
> (short of switching over to C++11) to use the Boost implementation? Is the
> TR1 implementation status of regex in libstdc++ likely to change in the
> future?
The TR1 code in libstdc++ is not going to change, so if Boost is an option then
yes, use that.