[patch] libstdc++/69386 Ensure C++ language linkage in cmath and cstdlib

Jonathan Wakely jwakely@redhat.com
Wed Jan 20 12:34:00 GMT 2016


On 19/01/16 21:43 +0000, Jonathan Wakely wrote:
>On 08/01/16 19:18 +0000, Jonathan Wakely wrote:
>>This resolves the longstanding issue that #include <math.h> uses the C
>>library header, which on most targets doesn't declare the additional
>>overloads required by C++11 26.8 [c.math], and similarly for
>><stdlib.h>.
>>
>>With this patch libstdc++ provides its own <math.h> and <stdlib.h>
>>wrappers, which are equivalent to <cmath> or <cstdlib> followed by
>>using-directives for all standard names. This means there are no more
>>inconsistencies in the contents of the <cxxx> and <xxx.h> headers.

The new wrappers might get included as:

extern "C" {
#include <stdlib.h>
}

which then includes <cstdlib> inside the extern "C" block, so we need
to ensure that the definitions in <cstdlib> get the right language
linkage.

Tested powerpc64le-linux, committed to trunk.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3775 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160120/f6db1c9d/attachment.bin>


More information about the Libstdc++ mailing list