Bug 33935 - overloads in C headers
Summary: overloads in C headers
Status: REOPENED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 49020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-29 00:25 UTC by Joseph S. Myers
Modified: 2016-01-17 02:36 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-01-14 20:47:13


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph S. Myers 2007-10-29 00:25:51 UTC
The C++ standard defines the C headers such as <string.h> and <wchar.h> in terms of their C++ versions such as <cstring> and <cwchar>, which in turn are defined in terms of the headers in the C standard.

Thus, <string.h> and <wchar.h> require the function overloads for functions such as strchr and wcschr that are defined to be in <cstring> and <cwchar>.  However, libstdc++ defines these only in <cstring> and <cwchar>, not in <string.h> and <wchar.h>.

libstdc++ needs to wrap the headers provided by the C library, or otherwise cooperate with glibc and other C library implementations, to get the required C++ definitions in place.

This is different from bug 6257, and unlike that bug this one appears still to be a bug with the current C++0x draft.
Comment 1 Paolo Carlini 2007-10-29 01:09:11 UTC
Yes, in some sense the resolution of DR 456 doesn't consider strchr and co. Some time ago I mentioned that in private email with Howard but then didn't really pursue it. Will do, maybe at one of the next C++ meetings.
Comment 2 Andrew Pinski 2007-12-02 22:25:07 UTC
Confirmed.
Comment 3 Paolo Carlini 2009-01-30 12:08:58 UTC
This is really the same as libstdc++/30928.

*** This bug has been marked as a duplicate of 30928 ***
Comment 4 Paolo Carlini 2010-01-14 20:47:00 UTC
Let's keep this one open instead, as a reminder that the libcs of non-GNU targets have to provide a mechanism similar to the one used by recent glibcs:

  http://gcc.gnu.org/viewcvs?view=revision&revision=143773

and which we can exploit in the C++ library.
Comment 5 Jonathan Wakely 2011-05-17 12:22:25 UTC
*** Bug 49020 has been marked as a duplicate of this bug. ***
Comment 6 Paolo Carlini 2011-05-18 10:08:22 UTC
*** Bug 49020 has been marked as a duplicate of this bug. ***