diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-02-07 23:00:07 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-02-07 23:00:07 +0000 |
commit | 00e598e3a92ab78db07f8d5ce00a5880884e6546 (patch) | |
tree | fcddbe55e6ea6d26a8ac887dd900414dbb1b342b /gcc/gcc.c | |
parent | fde6c29fcfa9fad5d14174e1a6e38b70c8035b4d (diff) | |
download | gcc-00e598e3a92ab78db07f8d5ce00a5880884e6546.tar.gz |
* gcc.c: Include <strings.h>/<string.h>, <stdlib.h>, <unistd.h>,
<fcntl.h>.
(free_path_suffix): Remove unreferenced static function.
(process_command): Remove unused variable temp.
(default_arg): Remove unused variable i.
(do_spec_1): Add parens for assignment used as truth value.
(main): Likewise.
(validate_all_switches): Likewise.
(main): Remove unused variables i, first_time>
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17768 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index 05e741f64ea..b9899052176 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -53,6 +53,26 @@ compilation is specified by a string called a "spec". */ #endif #include <stdio.h> +#ifdef HAVE_STRING_H +#include <string.h> +#else +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#endif + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif + #ifndef R_OK #define R_OK 4 #define W_OK 2 @@ -2101,25 +2121,6 @@ unused_prefix_warnings (pprefix) } } -/* Get rid of all prefixes built up so far in *PLISTP. */ - -static void -free_path_prefix (pprefix) - struct path_prefix *pprefix; -{ - struct prefix_list *pl = pprefix->plist; - struct prefix_list *temp; - - while (pl) - { - temp = pl; - pl = pl->next; - free (temp->prefix); - free ((char *) temp); - } - - pprefix->plist = (struct prefix_list *) 0; -} /* Execute the command specified by the arguments on the current line of spec. When using pipes, this includes several piped-together commands @@ -2697,7 +2698,6 @@ process_command (argc, argv) case 'B': { - int *temp = (int *) xmalloc (sizeof (int)); char *value; if (p[1] == 0 && i + 1 == argc) fatal ("argument to `-B' is missing"); @@ -3136,7 +3136,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) char *string; int value; - while (c = *p++) + while ((c = *p++)) /* If substituting a switch, treat all chars like letters. Otherwise, NL, SPC, TAB and % are special. */ switch (inswitch ? 'a' : c) @@ -4450,7 +4450,7 @@ main (argc, argv) first_time = FALSE; obstack_grow (&collect_obstack, "'-", 2); q = switches[i].part1; - while (p = (char *) index (q,'\'')) + while ((p = (char *) index (q,'\''))) { obstack_grow (&collect_obstack, q, p-q); obstack_grow (&collect_obstack, "'\\''", 4); @@ -4463,7 +4463,7 @@ main (argc, argv) { obstack_grow (&collect_obstack, " '", 2); q = *args; - while (p = (char *) index (q,'\'')) + while ((p = (char *) index (q,'\''))) { obstack_grow (&collect_obstack, q, p-q); obstack_grow (&collect_obstack, "'\\''", 4); @@ -4774,8 +4774,6 @@ main (argc, argv) if (error_count == 0) { int tmp = execution_count; - int i; - int first_time; /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables for collect. */ @@ -5090,7 +5088,7 @@ validate_all_switches () for (i = 0; i < sizeof comp->spec / sizeof comp->spec[0] && comp->spec[i]; i++) { p = comp->spec[i]; - while (c = *p++) + while ((c = *p++)) if (c == '%' && *p == '{') /* We have a switch spec. */ validate_switches (p + 1); @@ -5101,14 +5099,14 @@ validate_all_switches () for (spec = specs; spec ; spec = spec->next) { p = *(spec->ptr_spec); - while (c = *p++) + while ((c = *p++)) if (c == '%' && *p == '{') /* We have a switch spec. */ validate_switches (p + 1); } p = link_command_spec; - while (c = *p++) + while ((c = *p++)) if (c == '%' && *p == '{') /* We have a switch spec. */ validate_switches (p + 1); @@ -5257,7 +5255,6 @@ default_arg (p, len) int len; { char *start, *end; - int i; for (start = multilib_defaults; *start != '\0'; start = end+1) { |