gansidecl.h: Check if compiler supports __attribute__.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Mon, 6 Apr 1998 12:03:16 +0000 (12:03 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Mon, 6 Apr 1998 12:03:16 +0000 (12:03 +0000)
        * gansidecl.h: Check if compiler supports __attribute__.  Provide
        definitions for ATTRIBUTE_UNUSED and ATTRIBUTE_PRINTF using
        __attribute__ when its available.  Also provide definitions for
        ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2 and ATTRIBUTE_PRINTF_3 in
        terms of ATTRIBUTE_PRINTF.
        * genoutput.c (process_template): Use ATTRIBUTE_UNUSED in place
        of __attribute__.

From-SVN: r19019

gcc/ChangeLog
gcc/gansidecl.h
gcc/genoutput.c

index e74d6f395a1c09bf2fa167a60f874cddd84a90db..3a6db44977bf3db0895ccb98daa016d71eef1eaa 100644 (file)
@@ -1,3 +1,14 @@
+Mon Apr  6 14:59:58 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+        * gansidecl.h: Check if compiler supports __attribute__.  Provide
+        definitions for ATTRIBUTE_UNUSED and ATTRIBUTE_PRINTF using
+        __attribute__ when its available.  Also provide definitions for
+        ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2 and ATTRIBUTE_PRINTF_3 in
+        terms of ATTRIBUTE_PRINTF.
+        * genoutput.c (process_template): Use ATTRIBUTE_UNUSED in place
+       of __attribute__.
+
 Mon Apr  6 07:17:52 1998  Catherine Moore  <clm@cygnus.com>
 
         * combine.c (can_combine_p):  Include successor in volatile test.
index 09a369afd4ec60f81db3bddfa1b3550150ed9cc5..68cf7b26403904f0e0c9696a0703eb31552b25a0 100644 (file)
@@ -46,6 +46,21 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 
+#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+# define __attribute__(x)
+#endif
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((unused))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_PRINTF
+#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((format (__printf__, m, n)))
+#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
+#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
+#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
+#endif /* ATTRIBUTE_PRINTF */
+
 /* Define a generic NULL if one hasn't already been defined.  */
 
 #ifndef NULL
index 6af827dcb6e32eebe9e52d716a10cf7acdf2bef0..540685d3db59b0ad5d263d5136bace111d532496 100644 (file)
@@ -562,13 +562,8 @@ process_template (d, template)
 
   printf ("\nstatic char *\n");
   printf ("output_%d (operands, insn)\n", d->code_number);
-  printf ("#ifdef __GNUC__\n");
-  printf ("     rtx *operands __attribute__ ((unused));\n");
-  printf ("     rtx insn __attribute__ ((unused));\n");
-  printf ("#else\n");
-  printf ("     rtx *operands;\n");
-  printf ("     rtx insn;\n");
-  printf ("#endif\n");
+  printf ("     rtx *operands ATTRIBUTE_UNUSED;\n");
+  printf ("     rtx insn ATTRIBUTE_UNUSED;\n");
   printf ("{\n");
 
   /* If the assembler code template starts with a @ it is a newline-separated