aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1998-02-04 18:18:54 +0000
committerIan Lance Taylor <ian@airs.com>1998-02-04 18:18:54 +0000
commite8696467494f18e5f9ca68b4c23a5c7801f0b617 (patch)
tree9c098a6ec8f6ad2cb8cf28c932f9c2b023d561e0 /gas
parentab1f47c0c966aaacf227a3b7c0817e698813f3f2 (diff)
downloadgdb-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')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/as.h34
2 files changed, 31 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index db44d9e..67ac762 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+Wed Feb 4 13:17:19 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * as.h: If gcc version greater than 2.6, use `__format__' and
+ `__printf__' in function attributes, rather than `format' and
+ `printf'.
+
Mon Feb 2 18:38:18 1998 Ian Lance Taylor <ian@cygnus.com>
* config/tc-sparc.c: Only include elf/sparc.h if OBJ_ELF.
diff --git a/gas/as.h b/gas/as.h
index 64d418b..d86e8bf 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -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 *));