This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to fix target macro redefinition warnings
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 2 Dec 2001 19:49:56 -0500 (EST)
- Subject: Patch to fix target macro redefinition warnings
This patch fixes a bunch of "redefinition" warnings on various targets:
< config/alpha/alpha.h:2347:1: warning: this is the location of the previous definition
< config/elfos.h:73:1: warning: this is the location of the previous definition
< config/elfos.h:79:1: warning: this is the location of the previous definition
< config/i386/cygwin.h:474:1: warning: this is the location of the previous definition
< config/i386/uwin.h:32:1: warning: "MD_STARTFILE_PREFIX" redefined
< config/interix.h:25:1: warning: "TARGET_MEM_FUNCTIONS" redefined
< config/m68k/m68kemb.h:43:1: warning: this is the location of the previous definition
< config/psos.h:62:1: warning: "CPP_PREDEFINES" redefined
< config/rs6000/aix31.h:32:1: warning: this is the location of the previous definition
< config/rs6000/aix31.h:72:1: warning: this is the location of the previous definition
< config/rs6000/aix31.h:74:1: warning: this is the location of the previous definition
< config/rs6000/aix31.h:76:1: warning: this is the location of the previous definition
< config/rs6000/linux64.h:44:1: warning: "ROUND_TYPE_ALIGN" redefined
< config/rs6000/sysv4.h:398:1: warning: this is the location of the previous definition
< config/rs6000/xcoff.h:227:1: warning: "RS6000_MCOUNT" redefined
< config/rs6000/xcoff.h:231:1: warning: "RS6000_ITRUNC" redefined
< config/rs6000/xcoff.h:232:1: warning: "RS6000_UITRUNC" redefined
< config/rs6000/xcoff.h:379:1: warning: "ASM_OUTPUT_EXTERNAL" redefined
< config/sparc/liteelf.h:27:1: warning: "DWARF_DEBUGGING_INFO" redefined
< config/sparc/liteelf.h:28:1: warning: "DWARF2_DEBUGGING_INFO" redefined
< config/sparc/sp64-elf.h:120:1: warning: "UNALIGNED_DOUBLE_INT_ASM_OP" redefined
< config/sparc/sp86x-elf.h:27:1: warning: "DWARF_DEBUGGING_INFO" redefined
< config/sparc/sp86x-elf.h:28:1: warning: "DWARF2_DEBUGGING_INFO" redefined
< config/sparc/sparc.h:893:1: warning: this is the location of the previous definition
< config/sparc/sunos4.h:21:1: warning: "SUNOS4_SHARED_LIBRARIES" redefined
< config/sparc/sysv4.h:89:1: warning: this is the location of the previous definition
I also fixed one warning in rs6000.c when initializing "targetm".
< config/rs6000/rs6000.c:245: warning: initialization from incompatible pointer type
Tested via cross-compiles of cc1 to:
alpha-unknown-interix
i386-unknown-uwin
i386-unknown-interix
m68k-unknown-psos
rs6000-ibm-aix3.0
rs6000-ibm-aix3.2.4
powerpc64-unknown-linux-gnu
sparclite-unknown-coff
sparclite-unknown-aout
sparclite-unknown-elf
sparc86x-unknown-aout
sparc86x-unknown-elf
sparc64-unknown-aout
sparc64-unknown-elf
sparc64-unknown-linux-gnu
sparc-sun-sunos4.0
sparc-sun-sunos4.1
Okay to install?
Thanks,
--Kaveh
2001-12-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* i386/uwin.h (MD_STARTFILE_PREFIX): Avoid redefinition warnings.
* interix.h (TARGET_MEM_FUNCTIONS): Likewise.
* psos.h (CPP_PREDEFINES): Likewise.
* rs6000/linux64.h (ROUND_TYPE_ALIGN): Likewise.
* rs6000/xcoff.h (RS6000_MCOUNT, RS6000_ITRUNC, RS6000_UITRUNC,
ASM_OUTPUT_EXTERNAL): Likewise.
* sparc/liteelf.h (DWARF_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO):
Likewise.
* sparc/sp64-elf.h (UNALIGNED_DOUBLE_INT_ASM_OP): Likewise.
* sparc/sp86x-elf.h (DWARF_DEBUGGING_INFO, DWARF2_DEBUGGING_INFO):
Likewise.
* sparc/sunos4.h (SUNOS4_SHARED_LIBRARIES): Likewise.
* rs6000.c (rs6000_init_builtins): Delete unused parameter.
diff -rup orig/egcc-CVS20011201/gcc/config/i386/uwin.h egcc-CVS20011201/gcc/config/i386/uwin.h
--- orig/egcc-CVS20011201/gcc/config/i386/uwin.h Wed Oct 31 16:30:54 2001
+++ egcc-CVS20011201/gcc/config/i386/uwin.h Sun Dec 2 14:47:35 2001
@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#define STANDARD_INCLUDE_COMPONENT "UWIN"
#define SYSTEM_INCLUDE_DIR "/usr/gnu/include"
+#undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/gnu/lib/"
#undef CPP_PREDEFINES
diff -rup orig/egcc-CVS20011201/gcc/config/interix.h egcc-CVS20011201/gcc/config/interix.h
--- orig/egcc-CVS20011201/gcc/config/interix.h Wed Sep 15 17:41:13 1999
+++ egcc-CVS20011201/gcc/config/interix.h Sun Dec 2 14:31:46 2001
@@ -22,7 +22,9 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef TARGET_MEM_FUNCTIONS
#define TARGET_MEM_FUNCTIONS
+#endif
/* POSIX/Uni-thread only for now. Look at the winnt version
for windows/multi thread */
diff -rup orig/egcc-CVS20011201/gcc/config/psos.h egcc-CVS20011201/gcc/config/psos.h
--- orig/egcc-CVS20011201/gcc/config/psos.h Thu Aug 9 22:47:57 2001
+++ egcc-CVS20011201/gcc/config/psos.h Sun Dec 2 14:57:18 2001
@@ -59,6 +59,7 @@ Boston, MA 02111-1307, USA.
/* Predefined macros (independent of processor type). */
+#undef CPP_PREDEFINES
#define CPP_PREDEFINES "-Dpsos"
diff -rup orig/egcc-CVS20011201/gcc/config/rs6000/linux64.h egcc-CVS20011201/gcc/config/rs6000/linux64.h
--- orig/egcc-CVS20011201/gcc/config/rs6000/linux64.h Thu Nov 15 07:30:41 2001
+++ egcc-CVS20011201/gcc/config/rs6000/linux64.h Sun Dec 2 15:10:41 2001
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
/* AIX increases natural record alignment to doubleword if the first
field is an FP double while the FP fields remain word aligned. */
+#undef ROUND_TYPE_ALIGN
#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
((TREE_CODE (STRUCT) == RECORD_TYPE \
|| TREE_CODE (STRUCT) == UNION_TYPE \
diff -rup orig/egcc-CVS20011201/gcc/config/rs6000/rs6000.c egcc-CVS20011201/gcc/config/rs6000/rs6000.c
--- orig/egcc-CVS20011201/gcc/config/rs6000/rs6000.c Fri Nov 30 21:00:08 2001
+++ egcc-CVS20011201/gcc/config/rs6000/rs6000.c Sun Dec 2 15:06:47 2001
@@ -150,7 +150,7 @@ static int rs6000_adjust_cost PARAMS ((r
static int rs6000_adjust_priority PARAMS ((rtx, int));
static int rs6000_issue_rate PARAMS ((void));
-static void rs6000_init_builtins PARAMS ((tree));
+static void rs6000_init_builtins PARAMS ((void));
static void altivec_init_builtins PARAMS ((void));
static rtx rs6000_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
static rtx altivec_expand_builtin PARAMS ((tree, rtx));
@@ -3324,8 +3324,7 @@ rs6000_expand_builtin (exp, target, subt
}
static void
-rs6000_init_builtins (list_node)
- tree list_node ATTRIBUTE_UNUSED;
+rs6000_init_builtins ()
{
if (TARGET_ALTIVEC)
altivec_init_builtins ();
diff -rup orig/egcc-CVS20011201/gcc/config/rs6000/xcoff.h egcc-CVS20011201/gcc/config/rs6000/xcoff.h
--- orig/egcc-CVS20011201/gcc/config/rs6000/xcoff.h Thu Nov 15 07:30:43 2001
+++ egcc-CVS20011201/gcc/config/rs6000/xcoff.h Sun Dec 2 15:05:41 2001
@@ -224,11 +224,14 @@ toc_section () \
#define RESTORE_FP_SUFFIX ""
/* Function name to call to do profiling. */
+#undef RS6000_MCOUNT
#define RS6000_MCOUNT ".__mcount"
/* Function names to call to do floating point truncation. */
+#undef RS6000_ITRUNC
#define RS6000_ITRUNC "__itrunc"
+#undef RS6000_UITRUNC
#define RS6000_UITRUNC "__uitrunc"
/* This outputs NAME to FILE up to the first null or '['. */
@@ -376,6 +379,7 @@ toc_section () \
/* This says how to output an external. */
+#undef ASM_OUTPUT_EXTERNAL
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
if ((TREE_CODE (DECL) == VAR_DECL \
diff -rup orig/egcc-CVS20011201/gcc/config/sparc/liteelf.h egcc-CVS20011201/gcc/config/sparc/liteelf.h
--- orig/egcc-CVS20011201/gcc/config/sparc/liteelf.h Tue Nov 13 00:45:01 2001
+++ egcc-CVS20011201/gcc/config/sparc/liteelf.h Sun Dec 2 14:41:41 2001
@@ -24,7 +24,9 @@ Boston, MA 02111-1307, USA. */
/* Default to dwarf2 in ELF. */
+#undef DWARF_DEBUGGING_INFO
#define DWARF_DEBUGGING_INFO
+#undef DWARF2_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
diff -rup orig/egcc-CVS20011201/gcc/config/sparc/sp64-elf.h egcc-CVS20011201/gcc/config/sparc/sp64-elf.h
--- orig/egcc-CVS20011201/gcc/config/sparc/sp64-elf.h Wed Nov 14 18:11:48 2001
+++ egcc-CVS20011201/gcc/config/sparc/sp64-elf.h Sun Dec 2 15:14:06 2001
@@ -117,4 +117,5 @@ crtbegin.o%s \
/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler. */
+#undef UNALIGNED_DOUBLE_INT_ASM_OP
#define UNALIGNED_DOUBLE_INT_ASM_OP "\t.uaxword\t"
diff -rup orig/egcc-CVS20011201/gcc/config/sparc/sp86x-elf.h egcc-CVS20011201/gcc/config/sparc/sp86x-elf.h
--- orig/egcc-CVS20011201/gcc/config/sparc/sp86x-elf.h Tue Nov 13 00:45:02 2001
+++ egcc-CVS20011201/gcc/config/sparc/sp86x-elf.h Sun Dec 2 14:37:54 2001
@@ -24,7 +24,9 @@ Boston, MA 02111-1307, USA. */
/* Default to dwarf2 in ELF. */
+#undef DWARF_DEBUGGING_INFO
#define DWARF_DEBUGGING_INFO
+#undef DWARF2_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
diff -rup orig/egcc-CVS20011201/gcc/config/sparc/sunos4.h egcc-CVS20011201/gcc/config/sparc/sunos4.h
--- orig/egcc-CVS20011201/gcc/config/sparc/sunos4.h Wed Nov 14 18:11:48 2001
+++ egcc-CVS20011201/gcc/config/sparc/sunos4.h Sun Dec 2 15:19:03 2001
@@ -18,6 +18,7 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#undef SUNOS4_SHARED_LIBRARIES
#define SUNOS4_SHARED_LIBRARIES 1
#undef CPP_PREDEFINES