This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [GLIBC][PATCH v2] Remove strdup inlines
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 9 Feb 2017 21:57:44 +0000
- Subject: Re: [GLIBC][PATCH v2] Remove strdup inlines
- Authentication-results: sourceware.org; auth=none
- References: <AM5PR0802MB26104922C496F25DABAFC47283980@AM5PR0802MB2610.eurprd08.prod.outlook.com> <CAKCAbMh4uqH+7XLA4iRKohu_JPCKCJjxm0G+sDjVayxSgXxWXg@mail.gmail.com> <AM5PR0802MB2610771B31B5E13D39AFB89483980@AM5PR0802MB2610.eurprd08.prod.outlook.com> <AM5PR0802MB26105C61918F323EC765968F83450@AM5PR0802MB2610.eurprd08.prod.outlook.com> <6144d797-8520-29f1-c457-275fcb2a2b6c@linaro.org>
On Thu, 9 Feb 2017, Adhemerval Zanella wrote:
> Also for strdup I think __USE_XOPEN2K8 is not required, accordingly to manual
> it is defined for
>
> _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
strdup was XSI-shaded in the 2001 edition of POSIX but moved to CX-shaded
in the 2008 edition. That is, it should be declared for
_POSIX_C_SOURCE=200809L. That is, the existing __USE_XOPEN2K8 condition
(which means non-XSI 2008 edition of POSIX) is right.
> And __USE_XOPEN_EXTENDED will be set for _XOPEN_SOURCE >= 500 or if
> _XOPEN_SOURCE_EXTENDED is defined. At least all required defined are
> suffice on conform testcases for just
This indicates you've found a bug in the conform/ expectations - strdup
should be required there for POSIX2008.
--
Joseph S. Myers
joseph@codesourcery.com