diff options
author | Sahan Fernando <sahan.h.fernando@gmail.com> | 2020-12-25 15:12:40 +1100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-26 10:05:50 +0100 |
commit | 6b01d1cf142837b41795df183f783f99ad841dea (patch) | |
tree | 372147d195687a5f30169dae7fafce54edcd8d60 /Libraries/LibC/stdio.h | |
parent | 1cfdaf96c486eefac117040064bbcfb90da91c35 (diff) | |
download | serenity-6b01d1cf142837b41795df183f783f99ad841dea.zip |
LibC: Enable compiler warnings for printf format strings
Diffstat (limited to 'Libraries/LibC/stdio.h')
-rw-r--r-- | Libraries/LibC/stdio.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Libraries/LibC/stdio.h b/Libraries/LibC/stdio.h index b754f44fc8..18ce1da471 100644 --- a/Libraries/LibC/stdio.h +++ b/Libraries/LibC/stdio.h @@ -85,17 +85,17 @@ int feof(FILE*); int fflush(FILE*); size_t fread(void* ptr, size_t size, size_t nmemb, FILE*); size_t fwrite(const void* ptr, size_t size, size_t nmemb, FILE*); -int vprintf(const char* fmt, va_list); -int vfprintf(FILE*, const char* fmt, va_list); -int vsprintf(char* buffer, const char* fmt, va_list); -int vsnprintf(char* buffer, size_t, const char* fmt, va_list); -int fprintf(FILE*, const char* fmt, ...); -int printf(const char* fmt, ...); -int dbgprintf(const char* fmt, ...); +int vprintf(const char* fmt, va_list) __attribute__((format(printf, 1, 0))); +int vfprintf(FILE*, const char* fmt, va_list) __attribute__((format(printf, 2, 0))); +int vsprintf(char* buffer, const char* fmt, va_list) __attribute__((format(printf, 2, 0))); +int vsnprintf(char* buffer, size_t, const char* fmt, va_list) __attribute__((format(printf, 3, 0))); +int fprintf(FILE*, const char* fmt, ...) __attribute__((format(printf, 2, 3))); +int printf(const char* fmt, ...) __attribute__((format(printf, 1, 2))); +int dbgprintf(const char* fmt, ...) __attribute__((format(printf, 1, 2))); void dbgputch(char); int dbgputstr(const char*, ssize_t); -int sprintf(char* buffer, const char* fmt, ...); -int snprintf(char* buffer, size_t, const char* fmt, ...); +int sprintf(char* buffer, const char* fmt, ...) __attribute__((format(printf, 2, 3))); +int snprintf(char* buffer, size_t, const char* fmt, ...) __attribute__((format(printf, 3, 4))); int putchar(int ch); int putc(int ch, FILE*); int puts(const char*); |