summaryrefslogtreecommitdiff
path: root/srcpos.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2017-03-06 12:06:15 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2017-03-06 12:06:15 +1100
commit672ac09ea04d998dfddfdef3070a8af8d480182b (patch)
tree2df2c341562c7fedc27b7b2d44c97e77bd90593a /srcpos.h
parent49300f2ade6a6ad9b19957b1fce41fccfe1246a3 (diff)
downloaddevice-tree-compiler-672ac09ea04d998dfddfdef3070a8af8d480182b.tar.gz
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.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/srcpos.h b/srcpos.h
index 2cdfcd8..7caca82 100644
--- a/srcpos.h
+++ b/srcpos.h
@@ -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);