Warning fixes:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Wed, 28 Oct 1998 18:00:53 +0000 (18:00 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Wed, 28 Oct 1998 18:00:53 +0000 (18:00 +0000)
        * gcc.c (EXTRA_SPECS, extra_specs): Introduce an intermediate
        structure which has exactly the members provided by EXTRA_SPECS.
        Xmalloc() the real `extra_specs', and initialize it from this
        intermediate structure.
        * alpha.h (EXTRA_SPECS): Revert change for missing initializers.
        * mips.h  (EXTRA_SPECS): Likewise.
        * sparc.h (EXTRA_SPECS): Likewise.

From-SVN: r23406

gcc/ChangeLog
gcc/config/alpha/alpha.h
gcc/config/mips/mips.h
gcc/config/sparc/sparc.h
gcc/gcc.c

index 19085ed17bb3d999127297e68f9e17f0b11be6fd..5cf072880b6d3b970440fdd094b0ad440dbb471c 100644 (file)
@@ -1,3 +1,16 @@
+Wed Oct 28 20:52:47 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * gcc.c (EXTRA_SPECS, extra_specs): Introduce an intermediate
+       structure which has exactly the members provided by EXTRA_SPECS.
+       Xmalloc() the real `extra_specs', and initialize it from this
+       intermediate structure.
+
+       * alpha.h (EXTRA_SPECS): Revert change for missing initializers.
+
+       * mips.h  (EXTRA_SPECS): Likewise.
+
+       * sparc.h (EXTRA_SPECS): Likewise.
+
 Wed Oct 28 16:46:07 1998  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
     
        * function.c (purge_addressof_1): Instead of aborting when a
index d9efa596233fc1f1230d95338650cd4678129f93..1105bcab762c6aefc4e1c2c506bb02e4b6add97a 100644 (file)
@@ -308,21 +308,21 @@ extern char *alpha_mlat_string;   /* For -mmemory-latency= */
 #define SUBTARGET_EXTRA_SPECS
 #endif
 
-#define EXTRA_SPECS                                            \
-  { "cpp_am_bwx", CPP_AM_BWX_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_am_max", CPP_AM_MAX_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_am_cix", CPP_AM_CIX_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_im_ev4", CPP_IM_EV4_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_im_ev5", CPP_IM_EV5_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_im_ev6", CPP_IM_EV6_SPEC, 0, 0, 0, 0 },               \
-  { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC, 0, 0, 0, 0 },             \
-  { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC, 0, 0, 0, 0 },             \
-  { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC, 0, 0, 0, 0 },           \
-  { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC, 0, 0, 0, 0 },         \
-  { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC, 0, 0, 0, 0 },             \
-  { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC, 0, 0, 0, 0 },     \
-  { "cpp_cpu", CPP_CPU_SPEC, 0, 0, 0, 0 },                     \
-  { "cpp_subtarget", CPP_SUBTARGET_SPEC, 0, 0, 0, 0 },         \
+#define EXTRA_SPECS                            \
+  { "cpp_am_bwx", CPP_AM_BWX_SPEC },           \
+  { "cpp_am_max", CPP_AM_MAX_SPEC },           \
+  { "cpp_am_cix", CPP_AM_CIX_SPEC },           \
+  { "cpp_im_ev4", CPP_IM_EV4_SPEC },           \
+  { "cpp_im_ev5", CPP_IM_EV5_SPEC },           \
+  { "cpp_im_ev6", CPP_IM_EV6_SPEC },           \
+  { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC },         \
+  { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC },         \
+  { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC },       \
+  { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC },     \
+  { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC },         \
+  { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+  { "cpp_cpu", CPP_CPU_SPEC },                 \
+  { "cpp_subtarget", CPP_SUBTARGET_SPEC },     \
   SUBTARGET_EXTRA_SPECS
 
 
index 129624f7b1db2b1a3273d85aa31b9650312d66c8..538838b276653e2e5f84a970bd876ae38fdc45b3 100644 (file)
@@ -950,18 +950,18 @@ while (0)
    Do not define this macro if it does not need to do anything.  */
 
 #define EXTRA_SPECS                                                    \
-  { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC, 0, 0, 0, 0 },            \
-  { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC, 0, 0, 0, 0 },            \
-  { "subtarget_cpp_size_spec", SUBTARGET_CPP_SIZE_SPEC, 0, 0, 0, 0 },  \
-  { "long_max_spec", LONG_MAX_SPEC, 0, 0, 0, 0 },                      \
-  { "mips_as_asm_spec", MIPS_AS_ASM_SPEC, 0, 0, 0, 0 },                        \
-  { "gas_asm_spec", GAS_ASM_SPEC, 0, 0, 0, 0 },                                \
-  { "target_asm_spec", TARGET_ASM_SPEC, 0, 0, 0, 0 },                  \
-  { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC, 0, 0, 0, 0 }, \
-  { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC, 0, 0, 0, 0 }, \
-  { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC, 0, 0, 0, 0 }, \
-  { "subtarget_asm_spec", SUBTARGET_ASM_SPEC, 0, 0, 0, 0 },            \
-  { "linker_endian_spec", LINKER_ENDIAN_SPEC, 0, 0, 0, 0 },            \
+  { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC },                                \
+  { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC },                                \
+  { "subtarget_cpp_size_spec", SUBTARGET_CPP_SIZE_SPEC },              \
+  { "long_max_spec", LONG_MAX_SPEC },                                  \
+  { "mips_as_asm_spec", MIPS_AS_ASM_SPEC },                            \
+  { "gas_asm_spec", GAS_ASM_SPEC },                                    \
+  { "target_asm_spec", TARGET_ASM_SPEC },                              \
+  { "subtarget_mips_as_asm_spec", SUBTARGET_MIPS_AS_ASM_SPEC },        \
+  { "subtarget_asm_optimizing_spec", SUBTARGET_ASM_OPTIMIZING_SPEC },  \
+  { "subtarget_asm_debugging_spec", SUBTARGET_ASM_DEBUGGING_SPEC },    \
+  { "subtarget_asm_spec", SUBTARGET_ASM_SPEC },                                \
+  { "linker_endian_spec", LINKER_ENDIAN_SPEC },                                \
   SUBTARGET_EXTRA_SPECS
 
 #ifndef SUBTARGET_EXTRA_SPECS
index 5b50c2eb0be35d6b8e8b972b3b7a34564f007486..8bcabc5236bcf74189728947cbdc29490b8affad 100644 (file)
@@ -316,20 +316,20 @@ Unrecognized value in TARGET_CPU_DEFAULT.
    Do not define this macro if it does not need to do anything.  */
 
 #define EXTRA_SPECS \
-  { "cpp_cpu",         CPP_CPU_SPEC, 0, 0, 0, 0 },             \
-  { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC, 0, 0, 0, 0 },     \
-  { "cpp_arch32",      CPP_ARCH32_SPEC, 0, 0, 0, 0 },          \
-  { "cpp_arch64",      CPP_ARCH64_SPEC, 0, 0, 0, 0 },          \
-  { "cpp_arch_default",        CPP_ARCH_DEFAULT_SPEC, 0, 0, 0, 0 },    \
-  { "cpp_arch",                CPP_ARCH_SPEC, 0, 0, 0, 0 },            \
-  { "cpp_endian",      CPP_ENDIAN_SPEC, 0, 0, 0, 0 },          \
-  { "cpp_subtarget",   CPP_SUBTARGET_SPEC, 0, 0, 0, 0 },       \
-  { "asm_cpu",         ASM_CPU_SPEC, 0, 0, 0, 0 },             \
-  { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC, 0, 0, 0, 0 },     \
-  { "asm_arch32",      ASM_ARCH32_SPEC, 0, 0, 0, 0 },          \
-  { "asm_arch64",      ASM_ARCH64_SPEC, 0, 0, 0, 0 },          \
-  { "asm_arch_default",        ASM_ARCH_DEFAULT_SPEC, 0, 0, 0, 0 },    \
-  { "asm_arch",                ASM_ARCH_SPEC, 0, 0, 0, 0 },            \
+  { "cpp_cpu",         CPP_CPU_SPEC },         \
+  { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
+  { "cpp_arch32",      CPP_ARCH32_SPEC },      \
+  { "cpp_arch64",      CPP_ARCH64_SPEC },      \
+  { "cpp_arch_default",        CPP_ARCH_DEFAULT_SPEC },\
+  { "cpp_arch",                CPP_ARCH_SPEC },        \
+  { "cpp_endian",      CPP_ENDIAN_SPEC },      \
+  { "cpp_subtarget",   CPP_SUBTARGET_SPEC },   \
+  { "asm_cpu",         ASM_CPU_SPEC },         \
+  { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
+  { "asm_arch32",      ASM_ARCH32_SPEC },      \
+  { "asm_arch64",      ASM_ARCH64_SPEC },      \
+  { "asm_arch_default",        ASM_ARCH_DEFAULT_SPEC },\
+  { "asm_arch",                ASM_ARCH_SPEC },        \
   SUBTARGET_EXTRA_SPECS
 
 #define SUBTARGET_EXTRA_SPECS
index 1e95b04d81db4df2ed133dcd8b2c0ffc84f37f7c..28322e169fc342a9b7f66db4461d53279113cc1f 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1179,7 +1179,16 @@ static struct spec_list static_specs[] = {
 };
 
 #ifdef EXTRA_SPECS             /* additional specs needed */
-static struct spec_list extra_specs[] = { EXTRA_SPECS };
+/* Structure to keep track of just the first two args of a spec_list.
+   That is all that the EXTRA_SPECS macro gives us. */
+struct spec_list_1
+{
+  char *name;
+  char *ptr;
+};
+
+static struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
+static struct spec_list * extra_specs = (struct spec_list *)0;
 #endif
 
 /* List of dynamically allocates specs that have been defined so far.  */
@@ -1203,9 +1212,17 @@ init_spec ()
     fprintf (stderr, "Using builtin specs.\n");
 
 #ifdef EXTRA_SPECS
-  for (i = (sizeof (extra_specs) / sizeof (extra_specs[0])) - 1; i >= 0; i--)
+  extra_specs = (struct spec_list *)
+    xmalloc (sizeof(struct spec_list) *
+            (sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
+  bzero ((PTR) extra_specs, sizeof(struct spec_list) *
+        (sizeof(extra_specs_1)/sizeof(extra_specs_1[0])));
+  
+  for (i = (sizeof(extra_specs_1) / sizeof(extra_specs_1[0])) - 1; i >= 0; i--)
     {
       sl = &extra_specs[i];
+      sl->name = extra_specs_1[i].name;
+      sl->ptr = extra_specs_1[i].ptr;
       sl->next = next;
       sl->name_len = strlen (sl->name);
       sl->ptr_spec = &sl->ptr;