Skip to content

Commit 8016130

Browse files
Expand aliases for strto*_l() to short functions.
This removes warnings about incompatible pointer types in asm2 mode.
1 parent 8f85a8e commit 8016130

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

system/lib/libc.symbols

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
T scalbn
7474
T scalbnl
7575
T strtod
76-
W strtod_l
76+
T strtod_l
7777
T strtof
78-
W strtof_l
78+
T strtof_l
7979
T strtold
80-
W strtold_l
80+
T strtold_l
8181
W valloc

system/lib/libc/musl/readme.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Differences from upstream musl include:
1111
* Simplify fputwc to not rely on musl stream internals
1212
* signgam is no longer a weak alias of __signgam.
1313
* __toread and __towrite have had shutdown functionality removed.
14+
* Expand aliases for strto*_l() to short functions to remove warnings about incompatible pointer types.

system/lib/libc/musl/src/stdlib/strtod.c

+18-6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,21 @@ long double strtold(const char *restrict s, char **restrict p)
3232
return strtox(s, p, 2);
3333
}
3434

35-
weak_alias(strtof, strtof_l);
36-
weak_alias(strtod, strtod_l);
37-
weak_alias(strtold, strtold_l);
38-
weak_alias(strtof, __strtof_l);
39-
weak_alias(strtod, __strtod_l);
40-
weak_alias(strtold, __strtold_l);
35+
float strtof_l(const char *restrict s, char **restrict p, struct __locale_struct *loc)
36+
{
37+
return strtof(s, p);
38+
}
39+
40+
double strtod_l(const char *restrict s, char **restrict p, struct __locale_struct *loc)
41+
{
42+
return strtod(s, p);
43+
}
44+
45+
long double strtold_l(const char *restrict s, char **restrict p, struct __locale_struct *loc)
46+
{
47+
return strtold(s, p);
48+
}
49+
50+
weak_alias(strtof_l, __strtof_l);
51+
weak_alias(strtod_l, __strtod_l);
52+
weak_alias(strtold_l, __strtold_l);

0 commit comments

Comments
 (0)