From: Lei Zhang <zhanglei.april@gmail.com>
To: Luca Barbato <lu_zero@gentoo.org>
Cc: gentoo-musl@lists.gentoo.org
Subject: Re: [gentoo-musl] [GSoC] _GNU_SOURCE in C++
Date: Thu, 16 Jun 2016 11:36:15 +0800 [thread overview]
Message-ID: <CAOYuCc3Q69t-iLG837Virh4iOjZpsTHa6g_B3+9_UaqwFC-vOw@mail.gmail.com> (raw)
In-Reply-To: <19f9f66f-5dd4-786a-3b29-0a57c407548e@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
2016-06-15 17:36 GMT+08:00 Luca Barbato <lu_zero@gentoo.org>:
> On 15/06/16 03:45, Lei Zhang wrote:
>> This issue is probably not as simple as I thought. Supposing C++
>> header iostream depends on some non-standard functions from stdio.h,
>> it may look like:
>>
>> // iostream
>> #define _BSD_SOURCE
>> #include <stdio.h>
>> #undef _BSD_SOURCE
>> ...
>>
>> But if a user writes some code like:
>>
>
> Makes a mistake.
>
> You should not mix C headers and C++ headers like that =) There is a
> reason why you have <cstdio> and such =)
>
> The correct visibility macros can be extracted by reading the man pages
> for each of those functions.
>
> Please make the full list of them, once it is known we can discuss where
> to put them.
Attached is what I've got so far.
Some of them are not documented in man pages, so I checked their
declarations in musl's headers. Functions strtold_l, strtoll_l and
strtoull_l are not available in musl, but libc++ is smart enough to
not use them when linked against musl.
Lei
[-- Attachment #2: libcxx-nonstd-funcs.txt --]
[-- Type: text/plain, Size: 1019 bytes --]
# _ISOC11_SOURCE
aligned_alloc
# _BSD_SOURCE | _SVID_SOURCE | _ISOC99_SOURCE | _XOPEN_SOURCE >= 600 \
# | _POSIX_C_SOURCE >= 200112L
atoll
strtoll
strtoull
# _ISOC99_SOURCE | _XOPEN_SOURCE >= 600 | _POSIX_C_SOURCE >= 200112L
_Exit
isblank
iswblank
llabs
lldiv
strtof
strtold
vfscanf
vscanf
vsscanf
# _ISOC99_SOURCE | _XOPEN_SOURCE >= 500 | _POSIX_C_SOURCE >= 200112L
fwide
fwprintf
fwscanf
swprintf
vfwprintf
vswprintf
# _BSD_SOURCE | _ISOC99_SOURCE | _XOPEN_SOURCE >= 500 \
# | _POSIX_C_SOURCE >= 200112L
snprintf
vsnprintf
# _XOPEN_SOURCE >= 700
uselocale
# _GNU_SOURCE | _BSD_SOURCE
vasprintf
# _BSD_SOURCE | _SVID_SOURCE | _XOPEN_SOURCE
isascii
# _POSIX_SOURCE | _POSIX_C_SOURCE | _XOPEN_SOURCE | _GNU_SOURCE | _BSD_SOURCE
iswalpha_l
iswblank_l
iswcntrl_l
iswdigit_l
iswlower_l
iswprint_l
iswpunct_l
iswspace_l
iswupper_l
iswxdigit_l
# _GNU_SOURCE (absent in musl)
strtold_l
strtoll_l
strtoull_l
next prev parent reply other threads:[~2016-06-16 3:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 7:44 [gentoo-musl] [GSoC] _GNU_SOURCE in C++ Lei Zhang
2016-06-14 8:10 ` Felix Janda
2016-06-14 8:28 ` Lei Zhang
[not found] ` <4228046b-02f1-1b65-f56d-6e79347e4390@gentoo.org>
2016-06-14 9:17 ` Lei Zhang
[not found] ` <20302d1d-92ff-1c4b-8939-08894c3589ca@gentoo.org>
2016-06-14 9:35 ` Lei Zhang
[not found] ` <8e7cafd9-97c7-6ca1-ad3f-95bdb0060ce0@gentoo.org>
2016-06-14 11:48 ` Lei Zhang
[not found] ` <e1f362ee-7755-9a54-78e3-19e0733ebd3b@gentoo.org>
2016-06-15 1:45 ` Lei Zhang
[not found] ` <19f9f66f-5dd4-786a-3b29-0a57c407548e@gentoo.org>
2016-06-16 3:36 ` Lei Zhang [this message]
[not found] ` <1c93fa87-e2c3-2737-1222-ae93003e21ad@gentoo.org>
2016-06-16 12:47 ` Lei Zhang
[not found] ` <7d6fa9d6-1134-1d2a-1d06-33029b82429d@gentoo.org>
2016-06-16 13:42 ` Lei Zhang
2016-06-17 11:12 ` Lei Zhang
2016-06-17 11:13 ` Lei Zhang
[not found] ` <37117cc0-2af1-306d-6ec5-d8d37d8c588c@gentoo.org>
2016-06-17 12:44 ` Lei Zhang
2016-06-21 4:54 ` Lei Zhang
2016-06-22 13:21 ` Lei Zhang
2016-06-22 13:54 ` Lei Zhang
2016-06-22 14:02 ` Lei Zhang
2016-06-14 9:55 ` Felix Janda
[not found] ` <20160615033804.GA2473@gmail.com>
2016-06-15 3:55 ` Lei Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOYuCc3Q69t-iLG837Virh4iOjZpsTHa6g_B3+9_UaqwFC-vOw@mail.gmail.com \
--to=zhanglei.april@gmail.com \
--cc=gentoo-musl@lists.gentoo.org \
--cc=lu_zero@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox