diff options
author | Colin Walters <walters@verbum.org> | 2016-05-06 09:09:03 -0400 |
---|---|---|
committer | Colin Walters (automation) <walters+githubbot@verbum.org> | 2016-05-06 13:40:40 +0000 |
commit | a91f6a7469fbdf03d502e96443aa43db424c5f49 (patch) | |
tree | d54e780059bbcc54998676a54e02c6d22ba545b3 | |
parent | 90c20f2c8ead4d07524a33ffd55444f462e6ae52 (diff) | |
download | bubblewrap-a91f6a7469fbdf03d502e96443aa43db424c5f49.tar.gz |
utils: Add some __attribute__ annotations for format, noreturn
In particular `format` is important for validating strings. Luckily
we don't have any new warnings.
`noreturn` is mostly just helps avoid other warnings from unreachable
code.
Closes: #51
Approved by: rhatdan
-rw-r--r-- | utils.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -49,10 +49,10 @@ typedef int bool; #define PIPE_WRITE_END 1 void die_with_error (const char *format, - ...); + ...) __attribute__((__noreturn__)) __attribute__((format(printf, 1, 2))); void die (const char *format, - ...); -void die_oom (void); + ...) __attribute__((__noreturn__)); +void die_oom (void) __attribute__((__noreturn__)); void *xmalloc (size_t size); void *xcalloc (size_t size); void *xrealloc (void *ptr, @@ -69,7 +69,7 @@ char *strconcat3 (const char *s1, const char *s2, const char *s3); char* strdup_printf (const char *format, - ...); + ...) __attribute__((format(printf, 1, 2))); bool has_prefix (const char *str, const char *prefix); bool has_path_prefix (const char *str, |