summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-17 09:02:53 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-17 09:02:53 +0000
commit79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d (patch)
treed5c3fbab0ec01d2b0ca7d5278f15cf45f79b0763 /firmware
parent1329d7d3fde426a290c03ee92b1c701dde49851c (diff)
downloadrockbox-79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d.tar.gz
rockbox-79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d.zip
Let GCC check arguments of some more printf-style functions, also for plugins and codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12815 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/debug.h7
-rw-r--r--firmware/export/logf.h2
-rw-r--r--firmware/include/sprintf.h5
3 files changed, 8 insertions, 6 deletions
diff --git a/firmware/export/debug.h b/firmware/export/debug.h
index ce556d6418..ef56ea6092 100644
--- a/firmware/export/debug.h
+++ b/firmware/export/debug.h
@@ -19,9 +19,12 @@
#ifndef DEBUG_H
#define DEBUG_H
+#include <_ansi.h>
+
extern void debug_init(void);
-extern void debugf(const char* fmt,...);
-extern void ldebugf(const char* file, int line, const char *fmt, ...);
+extern void debugf(const char* fmt,...) ATTRIBUTE_PRINTF(1, 2);
+extern void ldebugf(const char* file, int line, const char *fmt, ...)
+ ATTRIBUTE_PRINTF(3, 4);
#ifdef __GNUC__
diff --git a/firmware/export/logf.h b/firmware/export/logf.h
index 35cb7127e4..145c5c5169 100644
--- a/firmware/export/logf.h
+++ b/firmware/export/logf.h
@@ -34,7 +34,7 @@ extern bool logfwrap;
#endif /* __PCTOOL__ */
#define logf _logf
-void _logf(const char *format, ...);
+void _logf(const char *format, ...) ATTRIBUTE_PRINTF(1, 2);
#else /* !ROCKBOX_HAS_LOGF */
/* built without logf() support enabled */
diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h
index 9f2ea7b404..74fa44bbf3 100644
--- a/firmware/include/sprintf.h
+++ b/firmware/include/sprintf.h
@@ -25,10 +25,9 @@
#include <_ansi.h>
int snprintf (char *buf, size_t size, const char *fmt, ...)
- ATTRIBUTE_PRINTF(3, 4);
+ ATTRIBUTE_PRINTF(3, 4);
int vsnprintf (char *buf, int size, const char *fmt, va_list ap);
-int fdprintf (int fd, const char *fmt, ...)
- ATTRIBUTE_PRINTF(2, 3);
+int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
#endif /* __SPRINTF_H__ */