-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libc: avoid weak_alias() warnings from gcc 9.
gcc 9 started to warn about alias created with different "attributes" (__attribute__(...)) from the source symbol. Unfortunately, in a couple of cases gcc also started to add a gratuituous "nothrow" attribute to our C code (which can never throw in any case...) and as a result, weak_alias throws. I tried to fix this in a number of ways, but none of them worked satisfactorily. This patch does something ugly, that works - add the nothrow attribute manually in the two places which had this problem. Unfortunately it means we edited yet another Musl source file (stdio/sscanf.c). Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <stdio.h> | ||
#include <stdarg.h> | ||
#include "libc.h" | ||
|
||
int sscanf(const char *restrict s, const char *restrict fmt, ...) | ||
{ | ||
int ret; | ||
va_list ap; | ||
va_start(ap, fmt); | ||
ret = vsscanf(s, fmt, ap); | ||
va_end(ap); | ||
return ret; | ||
} | ||
|
||
#if __GNUC__ >= 9 | ||
weak_alias(sscanf,__isoc99_sscanf) __attribute__((nothrow)); | ||
#else | ||
weak_alias(sscanf,__isoc99_sscanf); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters