This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/49020] Invalid std::strchr prototype in cstring
- 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: Wed, 18 May 2011 11:01:01 +0000
- Subject: [Bug libstdc++/49020] Invalid std::strchr prototype in cstring
- Auto-submitted: auto-generated
- References: <bug-49020-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49020
--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-18 10:22:42 UTC ---
(In reply to comment #15)
> The following code would work anyway:
No, it would make this ambiguous:
#include <cstring>
using namespace std;
int main()
{
strchr("foo", 'f');
}
(In reply to comment #16)
> Yes, workaround is obvious: add the const_cast to the return value. But is
> there a way to do without it?
Only with assistance from the C library, which is why this is a dup of PR 33935