aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--compat/mmap-blob.c4
-rw-r--r--lib.h13
-rw-r--r--token.h1
3 files changed, 9 insertions, 9 deletions
diff --git a/compat/mmap-blob.c b/compat/mmap-blob.c
index 6ddcd84a..3626cc73 100644
--- a/compat/mmap-blob.c
+++ b/compat/mmap-blob.c
@@ -18,7 +18,7 @@ void *blob_alloc(unsigned long size)
void *ptr;
if (size & ~CHUNK)
- die("internal error: bad allocation size (%d bytes)", size);
+ die("internal error: bad allocation size (%lu bytes)", size);
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (ptr == MAP_FAILED)
ptr = NULL;
@@ -28,6 +28,6 @@ void *blob_alloc(unsigned long size)
void blob_free(void *addr, unsigned long size)
{
if (!size || (size & ~CHUNK) || ((unsigned long) addr & 512))
- die("internal error: bad blob free (%d bytes at %p)", size, addr);
+ die("internal error: bad blob free (%lu bytes at %p)", size, addr);
munmap(addr, size);
}
diff --git a/lib.h b/lib.h
index 2abafa0a..00c939a2 100644
--- a/lib.h
+++ b/lib.h
@@ -64,14 +64,15 @@ typedef struct pseudo *pseudo_t;
struct token *skip_to(struct token *, int);
struct token *expect(struct token *, int, const char *);
#ifdef __GNUC__
-#define FORMAT_ATTR __attribute__ ((__format__ (__printf__, 2, 3)))
+#define FORMAT_ATTR(pos) __attribute__ ((__format__ (__printf__, pos, pos+1)))
#else
-#define FORMAT_ATTR
+#define FORMAT_ATTR(pos)
#endif
-extern void info(struct position, const char *, ...) FORMAT_ATTR;
-extern void warning(struct position, const char *, ...) FORMAT_ATTR;
-extern void error(struct position, const char *, ...) FORMAT_ATTR;
-extern void error_die(struct position, const char *, ...) FORMAT_ATTR;
+extern void die(const char *, ...) FORMAT_ATTR(1);
+extern void info(struct position, const char *, ...) FORMAT_ATTR(2);
+extern void warning(struct position, const char *, ...) FORMAT_ATTR(2);
+extern void error(struct position, const char *, ...) FORMAT_ATTR(2);
+extern void error_die(struct position, const char *, ...) FORMAT_ATTR(2);
#undef FORMAT_ATTR
#define __DECLARE_ALLOCATOR(type, x) \
diff --git a/token.h b/token.h
index cb462dfe..3db6beaf 100644
--- a/token.h
+++ b/token.h
@@ -190,7 +190,6 @@ extern const char *show_token(const struct token *);
extern struct token * tokenize(const char *, int, struct token *, const char **next_path);
extern struct token * tokenize_buffer(unsigned char *, unsigned long, struct token *);
-extern void die(const char *, ...);
extern void show_identifier_stats(void);
extern struct token *preprocess(struct token *);