diff options
author | Ian Lance Taylor <ian@airs.com> | 1998-02-04 18:18:54 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1998-02-04 18:18:54 +0000 |
commit | e8696467494f18e5f9ca68b4c23a5c7801f0b617 (patch) | |
tree | 9c098a6ec8f6ad2cb8cf28c932f9c2b023d561e0 /gas/as.h | |
parent | ab1f47c0c966aaacf227a3b7c0817e698813f3f2 (diff) | |
download | gdb-e8696467494f18e5f9ca68b4c23a5c7801f0b617.zip gdb-e8696467494f18e5f9ca68b4c23a5c7801f0b617.tar.gz gdb-e8696467494f18e5f9ca68b4c23a5c7801f0b617.tar.bz2 |
* as.h: If gcc version greater than 2.6, use `__format__' and
`__printf__' in function attributes, rather than `format' and
`printf'.
Diffstat (limited to 'gas/as.h')
-rw-r--r-- | gas/as.h | 34 |
1 files changed, 25 insertions, 9 deletions
@@ -490,21 +490,36 @@ typedef struct _pseudo_type pseudo_typeS; #ifdef USE_STDARG #if (__GNUC__ >= 2) && !defined(VMS) /* for use with -Wformat */ -#define PRINTF_LIKE(FCN) void FCN (const char *format, ...) \ - __attribute__ ((format (printf, 1, 2))) -#define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, unsigned int line, \ - const char *format, ...) \ - __attribute__ ((format (printf, 3, 4))) -#else /* ANSI C with stdarg, but not GNU C */ + +#if __GNUC_MINOR__ < 6 +/* Support for double underscores in attribute names was added in gcc + 2.6, so avoid them if we are using an earlier version. */ +#define __printf__ printf +#define __format__ format +#endif + +#define PRINTF_LIKE(FCN) \ + void FCN (const char *format, ...) \ + __attribute__ ((__format__ (__printf__, 1, 2))) +#define PRINTF_WHERE_LIKE(FCN) \ + void FCN (char *file, unsigned int line, const char *format, ...) \ + __attribute__ ((__format__ (__printf__, 3, 4))) + +#else /* __GNUC__ < 2 || defined(VMS) */ + #define PRINTF_LIKE(FCN) void FCN PARAMS ((const char *format, ...)) #define PRINTF_WHERE_LIKE(FCN) void FCN PARAMS ((char *file, \ unsigned int line, \ const char *format, ...)) -#endif -#else /* not using stdarg */ + +#endif /* __GNUC__ < 2 || defined(VMS) */ + +#else /* ! USE_STDARG */ + #define PRINTF_LIKE(FCN) void FCN () #define PRINTF_WHERE_LIKE(FCN) void FCN () -#endif + +#endif /* ! USE_STDARG */ PRINTF_LIKE (as_bad); PRINTF_LIKE (as_fatal); @@ -512,6 +527,7 @@ PRINTF_LIKE (as_tsktsk); PRINTF_LIKE (as_warn); PRINTF_WHERE_LIKE (as_bad_where); PRINTF_WHERE_LIKE (as_warn_where); + void as_assert PARAMS ((const char *, int, const char *)); void as_abort PARAMS ((const char *, int, const char *)); |