diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2017-03-06 12:06:15 +1100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-03-06 12:06:15 +1100 |
commit | 672ac09ea04d998dfddfdef3070a8af8d480182b (patch) | |
tree | 2df2c341562c7fedc27b7b2d44c97e77bd90593a /srcpos.h | |
parent | 49300f2ade6a6ad9b19957b1fce41fccfe1246a3 (diff) | |
download | dtc-672ac09ea04d998dfddfdef3070a8af8d480182b.zip dtc-672ac09ea04d998dfddfdef3070a8af8d480182b.tar.gz dtc-672ac09ea04d998dfddfdef3070a8af8d480182b.tar.bz2 |
Clean up gcc attributes
We have a number of explicit __GNUC__ conditionals to tell if we want to
use some gcc extensions for extra warnings. This cleans this up to use
a single conditional, defining convenience macros for those attributes.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'srcpos.h')
-rw-r--r-- | srcpos.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -22,6 +22,7 @@ #include <stdio.h> #include <stdbool.h> +#include "util.h" struct srcfile_state { FILE *f; @@ -106,12 +107,10 @@ extern void srcpos_update(struct srcpos *pos, const char *text, int len); extern struct srcpos *srcpos_copy(struct srcpos *pos); extern char *srcpos_string(struct srcpos *pos); -extern void srcpos_verror(struct srcpos *pos, const char *prefix, - const char *fmt, va_list va) - __attribute__((format(printf, 3, 0))); -extern void srcpos_error(struct srcpos *pos, const char *prefix, - const char *fmt, ...) - __attribute__((format(printf, 3, 4))); +extern void PRINTF(3, 0) srcpos_verror(struct srcpos *pos, const char *prefix, + const char *fmt, va_list va); +extern void PRINTF(3, 4) srcpos_error(struct srcpos *pos, const char *prefix, + const char *fmt, ...); extern void srcpos_set_line(char *f, int l); |