diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-11-23 22:53:13 +0100 |
---|---|---|
committer | Thomas Weißschuh <linux@weissschuh.net> | 2023-12-11 22:38:32 +0100 |
commit | dece8476d6dda087cacb8e105bb70e02a9ef9387 (patch) | |
tree | 8ca9eb2beb410d64ff4361666f7820a2493d5bb0 /tools/include | |
parent | b9e64724cd8aeca9e7ab4523a92ccf2ba0cd1de2 (diff) | |
download | lwn-dece8476d6dda087cacb8e105bb70e02a9ef9387.tar.gz lwn-dece8476d6dda087cacb8e105bb70e02a9ef9387.zip |
tools/nolibc: annotate va_list printf formats
__attribute__(format(printf)) can also be used for functions that take a
va_list argument.
As per the GCC docs:
For functions where the arguments are not available to be checked
(such as vprintf), specify the third parameter as zero.
Link: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/nolibc/stdio.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/include/nolibc/stdio.h b/tools/include/nolibc/stdio.h index d7ef43973916..16cd4d807251 100644 --- a/tools/include/nolibc/stdio.h +++ b/tools/include/nolibc/stdio.h @@ -212,7 +212,7 @@ char *fgets(char *s, int size, FILE *stream) * - %s * - unknown modifiers are ignored. */ -static __attribute__((unused)) +static __attribute__((unused, format(printf, 2, 0))) int vfprintf(FILE *stream, const char *fmt, va_list args) { char escape, lpref, c; @@ -318,7 +318,7 @@ int vfprintf(FILE *stream, const char *fmt, va_list args) return written; } -static __attribute__((unused)) +static __attribute__((unused, format(printf, 1, 0))) int vprintf(const char *fmt, va_list args) { return vfprintf(stdout, fmt, args); |