From 32b5482843c1227fef1afa8fe6974c373dd9a178 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 22 Jun 2013 14:04:43 -0700 Subject: Avoid some warnings from Sun C. Some versions of Sun C support __attribute__ but don't support the "unused" or "format" attributes - they don't fail, but they whine a lot. Check whether they can be used without warnings, and use them only if they can. --- gencode.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gencode.h') diff --git a/gencode.h b/gencode.h index c7f5a381..afb69338 100644 --- a/gencode.h +++ b/gencode.h @@ -336,7 +336,11 @@ struct block *gen_p80211_fcdir(int); void bpf_optimize(struct block **); void bpf_error(const char *, ...) - __attribute__((noreturn, format (printf, 1, 2))); + __attribute__((noreturn)) +#ifdef __ATTRIBUTE___FORMAT_OK + __attribute__((format (printf, 1, 2))) +#endif /* __ATTRIBUTE___FORMAT_OK */ + ; void finish_parse(struct block *); char *sdup(const char *); -- cgit v1.2.3