aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-12-31 22:38:58 +0000
committerRichard Stallman <rms@gnu.org>1992-12-31 22:38:58 +0000
commit3279bba682f7336a99bf4d191dad4e6d84a88302 (patch)
treecbee4c1977d7cb479766478518e81fe8923f7893
parent7e1909ee7f0706d38eaba1a9f5d75cb06299239c (diff)
downloadgcc-3279bba682f7336a99bf4d191dad4e6d84a88302.zip
gcc-3279bba682f7336a99bf4d191dad4e6d84a88302.tar.gz
gcc-3279bba682f7336a99bf4d191dad4e6d84a88302.tar.bz2
(do_spec_1): Propagate failure from recursive calls.
From-SVN: r3033
-rw-r--r--gcc/gcc.c61
1 files changed, 46 insertions, 15 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 050521d..7aaf159 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2364,6 +2364,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
register int c;
int i;
char *string;
+ int value;
while (c = *p++)
/* If substituting a switch, treat all chars like letters.
@@ -2407,7 +2408,7 @@ do_spec_1 (spec, inswitch, soft_matched_part)
if (argbuf_index > 0)
{
- int value = execute ();
+ value = execute ();
if (value)
return value;
}
@@ -2730,39 +2731,57 @@ do_spec_1 (spec, inswitch, soft_matched_part)
a certain constant string as a spec. */
case '1':
- do_spec_1 (cc1_spec, 0, NULL_PTR);
+ value = do_spec_1 (cc1_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case '2':
- do_spec_1 (cc1plus_spec, 0, NULL_PTR);
+ value = do_spec_1 (cc1plus_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'a':
- do_spec_1 (asm_spec, 0, NULL_PTR);
+ value = do_spec_1 (asm_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'A':
- do_spec_1 (asm_final_spec, 0, NULL_PTR);
+ value = do_spec_1 (asm_final_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'c':
- do_spec_1 (signed_char_spec, 0, NULL_PTR);
+ value = do_spec_1 (signed_char_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'C':
- do_spec_1 (cpp_spec, 0, NULL_PTR);
+ value = do_spec_1 (cpp_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'E':
- do_spec_1 (endfile_spec, 0, NULL_PTR);
+ value = do_spec_1 (endfile_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'l':
- do_spec_1 (link_spec, 0, NULL_PTR);
+ value = do_spec_1 (link_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'L':
- do_spec_1 (lib_spec, 0, NULL_PTR);
+ value = do_spec_1 (lib_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
case 'p':
@@ -2789,7 +2808,9 @@ do_spec_1 (spec, inswitch, soft_matched_part)
*x = 0;
- do_spec_1 (buf, 0, NULL_PTR);
+ value = do_spec_1 (buf, 0, NULL_PTR);
+ if (value != 0)
+ return value;
}
break;
@@ -2895,12 +2916,16 @@ do_spec_1 (spec, inswitch, soft_matched_part)
*x = 0;
- do_spec_1 (buf, 0, NULL_PTR);
+ value = do_spec_1 (buf, 0, NULL_PTR);
+ if (value != 0)
+ return value;
}
break;
case 'S':
- do_spec_1 (startfile_spec, 0, NULL_PTR);
+ value = do_spec_1 (startfile_spec, 0, NULL_PTR);
+ if (value != 0)
+ return value;
break;
/* Here we define characters other than letters and digits. */
@@ -2948,7 +2973,11 @@ do_spec_1 (spec, inswitch, soft_matched_part)
if (sl)
{
if (c == '(')
- do_spec_1 (name, 0, NULL_PTR);
+ {
+ value = do_spec_1 (name, 0, NULL_PTR);
+ if (value != 0)
+ return value;
+ }
else
{
char *x = (char *) alloca (strlen (name) * 2 + 1);
@@ -2981,7 +3010,9 @@ do_spec_1 (spec, inswitch, soft_matched_part)
}
*x = 0;
- do_spec_1 (buf, 0, NULL_PTR);
+ value = do_spec_1 (buf, 0, NULL_PTR);
+ if (value != 0)
+ return value;
}
}