summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-01-03 05:37:18 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-01-03 05:37:18 +0000
commit422ccce762edc5e328f07ffa42ada1d72676e616 (patch)
tree781dd7745b5d4992fae44724c55b902e125586b8 /src/lib
parent25eee632f605f5e80ba5b076566b39e46078b4a9 (diff)
(From Oliver Stoneberg)
This is an updated version of my earlier ATTR_PRINTF patch. It was reviewed by Atari Ace to use ATTR_PRINTF properly and fixes even more format errors. I also reviewed the whole source again and it is now used in all possible places.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/astring.h2
-rw-r--r--src/lib/util/corefile.h2
-rw-r--r--src/lib/util/options.c4
-rw-r--r--src/lib/util/pool.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h
index 3d80216383c..36ba50acb1d 100644
--- a/src/lib/util/astring.h
+++ b/src/lib/util/astring.h
@@ -70,7 +70,7 @@ astring *astring_inssubstr(astring *dst, int insbefore, const astring *src, int
astring *astring_substr(astring *str, int start, int count);
/* formatted printf to an astring */
-int astring_printf(astring *dst, const char *format, ...);
+int astring_printf(astring *dst, const char *format, ...) ATTR_PRINTF(2,3);
diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h
index dc9e69ce9f5..7e69809579e 100644
--- a/src/lib/util/corefile.h
+++ b/src/lib/util/corefile.h
@@ -100,7 +100,7 @@ int core_fputs(core_file *f, const char *s);
/* printf-style text write to a file */
int core_vfprintf(core_file *f, const char *fmt, va_list va);
-int CLIB_DECL core_fprintf(core_file *f, const char *fmt, ...);
+int CLIB_DECL core_fprintf(core_file *f, const char *fmt, ...) ATTR_PRINTF(2,3);
diff --git a/src/lib/util/options.c b/src/lib/util/options.c
index e090cae0399..e03b183436d 100644
--- a/src/lib/util/options.c
+++ b/src/lib/util/options.c
@@ -100,9 +100,9 @@ static options_data *find_entry_data(core_options *opts, const char *string, int
static void update_data(core_options *opts, options_data *data, const char *newdata, int priority);
static int parse_option_name(core_options *opts, const char *srcstring, options_data *data);
-static void message(core_options *opts, options_message msgtype, const char *format, ...);
+static void message(core_options *opts, options_message msgtype, const char *format, ...) ATTR_PRINTF(3,4);
static UINT32 hash_value(core_options *opts, const char *str);
-static void output_printf(void (*output)(const char *s), const char *format, ...);
+static void output_printf(void (*output)(const char *s), const char *format, ...) ATTR_PRINTF(2,3);
diff --git a/src/lib/util/pool.c b/src/lib/util/pool.c
index 62b131416fb..5729d289a1b 100644
--- a/src/lib/util/pool.c
+++ b/src/lib/util/pool.c
@@ -88,7 +88,7 @@ struct _object_pool_iterator
***************************************************************************/
static void memory_destruct(void *object, size_t size);
-static void report_failure(object_pool *pool, const char *format, ...);
+static void report_failure(object_pool *pool, const char *format, ...) ATTR_PRINTF(2,3);
@@ -268,7 +268,7 @@ void *pool_object_add_file_line(object_pool *pool, object_type _type, void *obje
/* if we have an invalid type, fail */
if (type == NULL)
{
- report_failure(pool, "pool_object_add (via %s:%d): Attempted to add object of unknown type", file, line, (int)size);
+ report_failure(pool, "pool_object_add (via %s:%d): Attempted to add object of unknown type with size %d", file, line, (int)size);
return object;
}