diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-24 08:08:29 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-12-24 08:08:29 -0500 |
commit | f2cf3e1ed979ba530eba3eed6c4e11725ac78a54 (patch) | |
tree | 59b359ce78227409d57969ed7c6de918683d0609 /gcc/gcc.c | |
parent | 340af9ef2d031fd19428a1febb795983e4dc4ac3 (diff) | |
download | gcc-f2cf3e1ed979ba530eba3eed6c4e11725ac78a54.zip gcc-f2cf3e1ed979ba530eba3eed6c4e11725ac78a54.tar.gz gcc-f2cf3e1ed979ba530eba3eed6c4e11725ac78a54.tar.bz2 |
(process_command): Give error for -c with -o and multiple compilations.
(handle_braces): Rename variable "pipe" to "pipe_p".
From-SVN: r10845
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -2346,6 +2346,8 @@ process_command (argc, argv) char *temp; char *spec_lang = 0; int last_language_n_infiles; + int have_c = 0; + int have_o = 0; gcc_exec_prefix = getenv ("GCC_EXEC_PREFIX"); @@ -2684,6 +2686,17 @@ process_command (argc, argv) n_switches++; break; } + + case 'c': + have_c = 1; + n_switches++; + break; + + case 'o': + have_o = 1; + + /* ... fall through ... */ + default: n_switches++; @@ -2697,6 +2710,9 @@ process_command (argc, argv) n_infiles++; } + if (have_c && have_o && n_infiles != 1) + fatal ("cannot specify -o with -c and multiple compilations"); + /* Set up the search paths before we go looking for config files. */ /* These come before the md prefixes so that we will find gcc's subcommands @@ -3828,7 +3844,7 @@ handle_braces (p) { register char *q; char *filter; - int pipe = 0; + int pipe_p = 0; int negate = 0; int suffix = 0; @@ -3836,7 +3852,7 @@ handle_braces (p) /* A `|' after the open-brace means, if the test fails, output a single minus sign rather than nothing. This is used in %{|!pipe:...}. */ - pipe = 1, ++p; + pipe_p = 1, ++p; if (*p == '!') /* A `!' after the open-brace negates the condition: @@ -3846,7 +3862,7 @@ handle_braces (p) if (*p == '.') /* A `.' after the open-brace means test against the current suffix. */ { - if (pipe) + if (pipe_p) abort (); suffix = 1; @@ -3987,7 +4003,7 @@ handle_braces (p) return 0; } } - else if (pipe) + else if (pipe_p) { /* Here if a %{|...} conditional fails: output a minus sign, which means "standard output" or "standard input". */ |