This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/49020] Invalid std::strchr prototype in cstring


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]