mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-09 05:06:48 +08:00
Warning fixes:
* 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
This commit is contained in:
parent
b5bd3b3c46
commit
829245be1b
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
21
gcc/gcc.c
21
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;
|
||||
|
Loading…
Reference in New Issue
Block a user