[committed] libstdc++: Test errno macros directly, not via autoconf [PR 93151]
Jonathan Wakely
jwakely@redhat.com
Thu Dec 17 16:21:42 GMT 2020
On 17/12/20 14:05 +0000, Jonathan Wakely wrote:
>On 16/12/20 13:38 +0000, Jonathan Wakely wrote:
>>This fixes a bug caused by a mismatch between the macros defined by
>><errno.h> when GCC is built and the macros defined by <errno.h> when
>>users include <system_error>. If the user code is compiled with
>>_XOPEN_SOURCE defined to 500 or 600, Darwin suppresses the
>>ENOTRECOVERABLE and EOWNERDEAD macros, which are not defined by SUSv3
>>(aka POSIX.1-2001).
>>
>>Since POSIX requires the errno macros to be macros (and not variables or
>>enumerators) we can just test for them directly using the preprocessor.
>>That means that <system_error> will match what is actuallydefined when
>>it's included, not what was defined when GCC was built. With that change
>>there is no need for the GLIBCXX_CHECK_SYSTEM_ERROR configure checks and
>>they can be removed.
>>
>>libstdc++-v3/ChangeLog:
>>
>> PR libstdc++/93151
>> * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Remove.
>> * configure.ac: Regenerate.
>
>Oops, that changelog was wrong.
>
>> * config/os/generic/error_constants.h: Test POSIX errno macros
>> directly, instead of corresponding _GLIBCXX_HAVE_EXXX macros.
>> * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc:
>> Likewise.
>> * testsuite/19_diagnostics/headers/system_error/93151.cc: New
>> test.
>
>I forgot to regenerate the autoconf files. Fixed in r11-6229.
>
>Tested powerpc64le-linux. Committed to trunk.
>
> libstdc++-v3/ChangeLog:
>
> * config.h.in: Regenerate.
> * configure: Regenerate.
Oops, and I also forgot to update the other headers that were using
those autoconf-generated macros!
Fixed by this patch. Tested on mingw-w64, pushed to trunk.
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 9161 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20201217/5f911704/attachment-0001.bin>
More information about the Libstdc++
mailing list