mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
software/include/base/stdio: Enable printf format strings checks
Now all format issues are fixed, tag all functions taking printf()-style format specifiers with "__attribute__((format(printf, ...))", enabling format string checks ("-Wall" includes "-Wformat"). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
c3dea1b9fd
commit
0f28bc489d
1 changed files with 5 additions and 5 deletions
|
@ -10,11 +10,11 @@ extern "C" {
|
||||||
int putchar(int c);
|
int putchar(int c);
|
||||||
int puts(const char *s);
|
int puts(const char *s);
|
||||||
|
|
||||||
int snprintf(char *buf, size_t size, const char *fmt, ...);
|
int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
|
||||||
int scnprintf(char *buf, size_t size, const char *fmt, ...);
|
int scnprintf(char *buf, size_t size, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
|
||||||
int sprintf(char *buf, const char *fmt, ...);
|
int sprintf(char *buf, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
|
||||||
|
|
||||||
int printf(const char *fmt, ...);
|
int printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
|
||||||
|
|
||||||
/* Not sure this belongs here... */
|
/* Not sure this belongs here... */
|
||||||
typedef long long loff_t;
|
typedef long long loff_t;
|
||||||
|
@ -53,7 +53,7 @@ extern FILE *stdin;
|
||||||
extern FILE *stdout;
|
extern FILE *stdout;
|
||||||
extern FILE *stderr;
|
extern FILE *stderr;
|
||||||
|
|
||||||
int fprintf(FILE *stream, const char *format, ...);
|
int fprintf(FILE *stream, const char *format, ...) __attribute__((format(printf, 2, 3)));
|
||||||
int fflush(FILE *stream);
|
int fflush(FILE *stream);
|
||||||
|
|
||||||
FILE *fopen(const char *path, const char *mode);
|
FILE *fopen(const char *path, const char *mode);
|
||||||
|
|
Loading…
Reference in a new issue