aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Triplett <josh@freedesktop.org>2007-03-09 16:32:16 -0800
committerJosh Triplett <josh@freedesktop.org>2007-03-09 16:32:16 -0800
commite7680876c48d0f5470b72f3f51fa13f72122b19e (patch)
tree8c5fd8fadac609318810b8f06e826c746320f54a /show-parse.c
parentFix typos in comments (diff)
downloadsparse-e7680876c48d0f5470b72f3f51fa13f72122b19e.tar.gz
sparse-e7680876c48d0f5470b72f3f51fa13f72122b19e.tar.bz2
sparse-e7680876c48d0f5470b72f3f51fa13f72122b19e.zip
Use GCC format and sentinel attributes on appropriate functions
Expose the FORMAT_ATTR portability macro in lib.h, and use it on the various printf-like functions in sparse. Add a new SENTINEL_ATTR portability macro for the GCC sentinel attribute, and use it on match_idents in parse.c. match_oplist in expression.c should use SENTINEL_ATTR, but GCC does not accept an integer 0 as a sentinel, only a pointer 0 like NULL. Signed-off-by: Josh Triplett <josh@freedesktop.org>
Diffstat (limited to 'show-parse.c')
-rw-r--r--show-parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/show-parse.c b/show-parse.c
index 3bfe5a9..0bef01c 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -144,7 +144,7 @@ struct type_name {
char *end;
};
-static void prepend(struct type_name *name, const char *fmt, ...)
+static void FORMAT_ATTR(2) prepend(struct type_name *name, const char *fmt, ...)
{
static char buffer[512];
int n;
@@ -158,7 +158,7 @@ static void prepend(struct type_name *name, const char *fmt, ...)
memcpy(name->start, buffer, n);
}
-static void append(struct type_name *name, const char *fmt, ...)
+static void FORMAT_ATTR(2) append(struct type_name *name, const char *fmt, ...)
{
static char buffer[512];
int n;