1 |
2016-06-16 21:13 GMT+08:00 Luca Barbato <lu_zero@g.o>: |
2 |
> On 16/06/16 14:47, Lei Zhang wrote: |
3 |
>> 2016-06-16 17:43 GMT+08:00 Luca Barbato <lu_zero@g.o>: |
4 |
>>> On 16/06/16 05:36, Lei Zhang wrote: |
5 |
>>>> Attached is what I've got so far. |
6 |
>>>> |
7 |
>>>> Some of them are not documented in man pages, so I checked their |
8 |
>>>> declarations in musl's headers. Functions strtold_l, strtoll_l and |
9 |
>>>> strtoull_l are not available in musl, but libc++ is smart enough to |
10 |
>>>> not use them when linked against musl. |
11 |
>> |
12 |
>> I made a mistake. Actually strtold_l *is* available in musl, but |
13 |
>> hidden by _GNU_SOURCE. |
14 |
> |
15 |
> Not hidden by _BSD_SOURCE as well? |
16 |
|
17 |
No, only by _GNU_SOURCE. |
18 |
|
19 |
>>> beside vasprintf, the rest is covered by _XOPEN_SOURCE 700 |
20 |
>>> |
21 |
>>> Might be worth trying to do -U_GNU_SOURCES -D_XOPEN_SOURCE=700 and see |
22 |
>>> how it goes. |
23 |
>> |
24 |
>> So far vasprintf and strtold_l are not covered. vasprintf can be |
25 |
>> covered with -D_BSD_SOURCE. But _BSD_SOURCE is deprecated since glibc |
26 |
>> 2.20; I don't know if this has any impact on musl. |
27 |
> |
28 |
> It should not and -D_BSD_SOURCE should be fine for musl. |
29 |
|
30 |
I just found that vasprintf is only protected by _GNU_SOURCE in glibc, |
31 |
which means in this case _BSD_SOURCE only works for musl. |
32 |
|
33 |
>>> How vasprintf is used? |
34 |
>> |
35 |
>> It's used by <locale>. The code is kinda hard to read; I can't tell |
36 |
>> exactly what it's doing... |
37 |
> |
38 |
> same for the _l variants I guess. |
39 |
|
40 |
So what now? So far strtold_l still needs _GNU_SOURCE in musl; |
41 |
strtold_l, strtoll_l, strtoull_l and vasprintf all need _GNU_SOURCE in |
42 |
glibc. |
43 |
|
44 |
|
45 |
Lei |