aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-10-28 18:00:53 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-10-28 18:00:53 +0000
commit829245be1bfefcd312479e94752c35c7b2cb3348 (patch)
tree42470feb11450cf3a835fa2970afa3051887c4e2 /gcc/gcc.c
parentb5bd3b3c46692ddb40a623b2728c65164f59fed3 (diff)
downloadgcc-829245be1bfefcd312479e94752c35c7b2cb3348.zip
gcc-829245be1bfefcd312479e94752c35c7b2cb3348.tar.gz
gcc-829245be1bfefcd312479e94752c35c7b2cb3348.tar.bz2
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
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 1e95b04..28322e1 100644
--- 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;