Commit d25a45d4 by Kazu Hirata Committed by Kazu Hirata

gcc.c: Fix formatting.

2000-09-15  Kazu Hirata  <kazu@hxi.com>

	* gcc.c: Fix formatting.

From-SVN: r36439
parent d7ce9a83
2000-09-15 Kazu Hirata <kazu@hxi.com> 2000-09-15 Kazu Hirata <kazu@hxi.com>
* config/i386/i386.md: Fix a comment typo. * config/i386/i386.md: Fix a comment typo.
* gcc.c: Fix formatting.
2000-09-15 Bernd Schmidt <bernds@redhat.co.uk> 2000-09-15 Bernd Schmidt <bernds@redhat.co.uk>
......
...@@ -73,7 +73,7 @@ extern int getrusage PARAMS ((int, struct rusage *)); ...@@ -73,7 +73,7 @@ extern int getrusage PARAMS ((int, struct rusage *));
#endif /* DIR_UP */ #endif /* DIR_UP */
#endif /* VMS */ #endif /* VMS */
static char dir_separator_str[] = {DIR_SEPARATOR, 0}; static char dir_separator_str[] = { DIR_SEPARATOR, 0 };
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -1027,7 +1027,8 @@ skip_whitespace (p) ...@@ -1027,7 +1027,8 @@ skip_whitespace (p)
p++; p++;
else if (*p == '#') else if (*p == '#')
{ {
while (*p != '\n') p++; while (*p != '\n')
p++;
p++; p++;
} }
else else
...@@ -1057,7 +1058,7 @@ struct spec_list ...@@ -1057,7 +1058,7 @@ struct spec_list
}; };
#define INIT_STATIC_SPEC(NAME,PTR) \ #define INIT_STATIC_SPEC(NAME,PTR) \
{ NAME, NULL_PTR, PTR, (struct spec_list *) 0, sizeof (NAME)-1, 0 } { NAME, NULL_PTR, PTR, (struct spec_list *) 0, sizeof (NAME) - 1, 0 }
/* List of statically defined specs. */ /* List of statically defined specs. */
static struct spec_list static_specs[] = static struct spec_list static_specs[] =
...@@ -1100,7 +1101,7 @@ struct spec_list_1 ...@@ -1100,7 +1101,7 @@ struct spec_list_1
}; };
static struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS }; static struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS };
static struct spec_list * extra_specs = (struct spec_list *) 0; static struct spec_list *extra_specs = (struct spec_list *) 0;
#endif #endif
/* List of dynamically allocates specs that have been defined so far. */ /* List of dynamically allocates specs that have been defined so far. */
...@@ -1378,7 +1379,7 @@ store_arg (arg, delete_always, delete_failure) ...@@ -1378,7 +1379,7 @@ store_arg (arg, delete_always, delete_failure)
various different types of line-endings, \r\n, \n\r and just \r, with various different types of line-endings, \r\n, \n\r and just \r, with
a single \n. */ a single \n. */
static char* static char *
load_specs (filename) load_specs (filename)
const char *filename; const char *filename;
{ {
...@@ -1416,9 +1417,9 @@ load_specs (filename) ...@@ -1416,9 +1417,9 @@ load_specs (filename)
char c = *buffer_p; char c = *buffer_p;
if (c == '\r') if (c == '\r')
{ {
if (buffer_p > buffer && *(buffer_p-1) == '\n') /* \n\r */ if (buffer_p > buffer && *(buffer_p - 1) == '\n') /* \n\r */
skip = 1; skip = 1;
else if (*(buffer_p+1) == '\n') /* \r\n */ else if (*(buffer_p + 1) == '\n') /* \r\n */
skip = 1; skip = 1;
else /* \r */ else /* \r */
c = '\n'; c = '\n';
...@@ -1475,9 +1476,10 @@ read_specs (filename, main_p) ...@@ -1475,9 +1476,10 @@ read_specs (filename, main_p)
while (*p && *p != '\n') while (*p && *p != '\n')
p++; p++;
p++; /* Skip '\n' */ /* Skip '\n'. */
p++;
if (!strncmp (p1, "%include", sizeof ("%include")-1) if (!strncmp (p1, "%include", sizeof ("%include") - 1)
&& (p1[sizeof "%include" - 1] == ' ' && (p1[sizeof "%include" - 1] == ' '
|| p1[sizeof "%include" - 1] == '\t')) || p1[sizeof "%include" - 1] == '\t'))
{ {
...@@ -1503,7 +1505,8 @@ read_specs (filename, main_p) ...@@ -1503,7 +1505,8 @@ read_specs (filename, main_p)
char *new_filename; char *new_filename;
p1 += sizeof "%include_noerr"; p1 += sizeof "%include_noerr";
while (*p1 == ' ' || *p1 == '\t') p1++; while (*p1 == ' ' || *p1 == '\t')
p1++;
if (*p1++ != '<' || p[-2] != '>') if (*p1++ != '<' || p[-2] != '>')
fatal ("specs %%include syntax malformed after %ld characters", fatal ("specs %%include syntax malformed after %ld characters",
...@@ -1550,12 +1553,12 @@ read_specs (filename, main_p) ...@@ -1550,12 +1553,12 @@ read_specs (filename, main_p)
fatal ("specs %%rename syntax malformed after %ld characters", fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p2 - buffer)); (long) (p2 - buffer));
/* Get new spec name */ /* Get new spec name. */
p3 = p2; p3 = p2;
while (*p3 && !ISSPACE ((unsigned char) *p3)) while (*p3 && !ISSPACE ((unsigned char) *p3))
p3++; p3++;
if (p3 != p-1) if (p3 != p - 1)
fatal ("specs %%rename syntax malformed after %ld characters", fatal ("specs %%rename syntax malformed after %ld characters",
(long) (p3 - buffer)); (long) (p3 - buffer));
*p3 = '\0'; *p3 = '\0';
...@@ -1713,7 +1716,7 @@ record_temp_file (filename, always_delete, fail_delete) ...@@ -1713,7 +1716,7 @@ record_temp_file (filename, always_delete, fail_delete)
int always_delete; int always_delete;
int fail_delete; int fail_delete;
{ {
register char * const name = xstrdup (filename); register char *const name = xstrdup (filename);
if (always_delete) if (always_delete)
{ {
...@@ -1842,17 +1845,16 @@ putenv (str) ...@@ -1842,17 +1845,16 @@ putenv (str)
} }
/* Add a new environment variable */ /* Add a new environment variable */
environ = (char **) xmalloc (sizeof (char *) * (num_envs+2)); environ = (char **) xmalloc (sizeof (char *) * (num_envs + 2));
*environ = str; *environ = str;
memcpy ((char *) (environ + 1), (char *) old_environ, memcpy ((char *) (environ + 1), (char *) old_environ,
sizeof (char *) * (num_envs+1)); sizeof (char *) * (num_envs + 1));
#endif /* VMS */ #endif /* VMS */
} }
#endif /* HAVE_PUTENV */ #endif /* HAVE_PUTENV */
/* Build a list of search directories from PATHS. /* Build a list of search directories from PATHS.
PREFIX is a string to prepend to the list. PREFIX is a string to prepend to the list.
If CHECK_DIR_P is non-zero we ensure the directory exists. If CHECK_DIR_P is non-zero we ensure the directory exists.
...@@ -2014,7 +2016,7 @@ free_split_directories (dirs) ...@@ -2014,7 +2016,7 @@ free_split_directories (dirs)
while (dirs[i] != NULL_PTR) while (dirs[i] != NULL_PTR)
free (dirs[i++]); free (dirs[i++]);
free ((char *)dirs); free ((char *) dirs);
} }
/* Given three strings PROGNAME, BIN_PREFIX, PREFIX, return a string that gets /* Given three strings PROGNAME, BIN_PREFIX, PREFIX, return a string that gets
...@@ -2065,14 +2067,14 @@ make_relative_prefix (progname, bin_prefix, prefix) ...@@ -2065,14 +2067,14 @@ make_relative_prefix (progname, bin_prefix, prefix)
} }
else else
{ {
strncpy (nstore, startp, endp-startp); strncpy (nstore, startp, endp - startp);
if (! IS_DIR_SEPARATOR (endp[-1])) if (! IS_DIR_SEPARATOR (endp[-1]))
{ {
nstore[endp-startp] = DIR_SEPARATOR; nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0; nstore[endp - startp + 1] = 0;
} }
else else
nstore[endp-startp] = 0; nstore[endp - startp] = 0;
} }
strcat (nstore, progname); strcat (nstore, progname);
if (! access (nstore, X_OK) if (! access (nstore, X_OK)
...@@ -2148,7 +2150,7 @@ make_relative_prefix (progname, bin_prefix, prefix) ...@@ -2148,7 +2150,7 @@ make_relative_prefix (progname, bin_prefix, prefix)
/* Now build up the ..'s. */ /* Now build up the ..'s. */
for (i = common; i < n; i++) for (i = common; i < n; i++)
{ {
obstack_grow (&obstack, DIR_UP, sizeof (DIR_UP)-1); obstack_grow (&obstack, DIR_UP, sizeof (DIR_UP) - 1);
obstack_1grow (&obstack, DIR_SEPARATOR); obstack_1grow (&obstack, DIR_SEPARATOR);
} }
...@@ -2415,8 +2417,7 @@ execute () ...@@ -2415,8 +2417,7 @@ execute ()
n_commands++; n_commands++;
/* Get storage for each command. */ /* Get storage for each command. */
commands commands = (struct command *) alloca (n_commands * sizeof (struct command));
= (struct command *) alloca (n_commands * sizeof (struct command));
/* Split argbuf into its separate piped processes, /* Split argbuf into its separate piped processes,
and record info about each one. and record info about each one.
...@@ -2455,7 +2456,7 @@ execute () ...@@ -2455,7 +2456,7 @@ execute ()
fputc ('\n', stderr); fputc ('\n', stderr);
/* Print each piped command as a separate line. */ /* Print each piped command as a separate line. */
for (i = 0; i < n_commands ; i++) for (i = 0; i < n_commands; i++)
{ {
const char *const *j; const char *const *j;
...@@ -2521,7 +2522,7 @@ execute () ...@@ -2521,7 +2522,7 @@ execute ()
double ut = 0.0, st = 0.0; double ut = 0.0, st = 0.0;
#endif #endif
for (i = 0; i < n_commands; ) for (i = 0; i < n_commands;)
{ {
int j; int j;
int status; int status;
...@@ -2542,11 +2543,11 @@ execute () ...@@ -2542,11 +2543,11 @@ execute ()
getrusage (RUSAGE_CHILDREN, &rus); getrusage (RUSAGE_CHILDREN, &rus);
d.tv_sec = rus.ru_utime.tv_sec - prus.ru_utime.tv_sec; d.tv_sec = rus.ru_utime.tv_sec - prus.ru_utime.tv_sec;
d.tv_usec = rus.ru_utime.tv_usec - prus.ru_utime.tv_usec; d.tv_usec = rus.ru_utime.tv_usec - prus.ru_utime.tv_usec;
ut = (double)d.tv_sec + (double)d.tv_usec / 1.0e6; ut = (double) d.tv_sec + (double) d.tv_usec / 1.0e6;
d.tv_sec = rus.ru_stime.tv_sec - prus.ru_stime.tv_sec; d.tv_sec = rus.ru_stime.tv_sec - prus.ru_stime.tv_sec;
d.tv_usec = rus.ru_stime.tv_usec - prus.ru_stime.tv_usec; d.tv_usec = rus.ru_stime.tv_usec - prus.ru_stime.tv_usec;
st = (double)d.tv_sec + (double)d.tv_usec / 1.0e6; st = (double) d.tv_sec + (double) d.tv_usec / 1.0e6;
} }
#endif #endif
...@@ -2767,7 +2768,7 @@ on to these processes the -W<letter> options must be used.\n\ ...@@ -2767,7 +2768,7 @@ on to these processes the -W<letter> options must be used.\n\
static void static void
add_preprocessor_option (option, len) add_preprocessor_option (option, len)
const char * option; const char *option;
int len; int len;
{ {
n_preprocessor_options++; n_preprocessor_options++;
...@@ -2786,7 +2787,7 @@ add_preprocessor_option (option, len) ...@@ -2786,7 +2787,7 @@ add_preprocessor_option (option, len)
static void static void
add_assembler_option (option, len) add_assembler_option (option, len)
const char * option; const char *option;
int len; int len;
{ {
n_assembler_options++; n_assembler_options++;
...@@ -2804,7 +2805,7 @@ add_assembler_option (option, len) ...@@ -2804,7 +2805,7 @@ add_assembler_option (option, len)
static void static void
add_linker_option (option, len) add_linker_option (option, len)
const char * option; const char *option;
int len; int len;
{ {
n_linker_options++; n_linker_options++;
...@@ -2873,14 +2874,14 @@ process_command (argc, argv) ...@@ -2873,14 +2874,14 @@ process_command (argc, argv)
if (gcc_exec_prefix) if (gcc_exec_prefix)
{ {
int len = strlen (gcc_exec_prefix); int len = strlen (gcc_exec_prefix);
if (len > (int) sizeof ("/lib/gcc-lib/")-1 if (len > (int) sizeof ("/lib/gcc-lib/") - 1
&& (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1]))) && (IS_DIR_SEPARATOR (gcc_exec_prefix[len-1])))
{ {
temp = gcc_exec_prefix + len - sizeof ("/lib/gcc-lib/") + 1; temp = gcc_exec_prefix + len - sizeof ("/lib/gcc-lib/") + 1;
if (IS_DIR_SEPARATOR (*temp) if (IS_DIR_SEPARATOR (*temp)
&& strncmp (temp+1, "lib", 3) == 0 && strncmp (temp + 1, "lib", 3) == 0
&& IS_DIR_SEPARATOR (temp[4]) && IS_DIR_SEPARATOR (temp[4])
&& strncmp (temp+5, "gcc-lib", 7) == 0) && strncmp (temp + 5, "gcc-lib", 7) == 0)
len -= sizeof ("/lib/gcc-lib/") - 1; len -= sizeof ("/lib/gcc-lib/") - 1;
} }
...@@ -2905,16 +2906,16 @@ process_command (argc, argv) ...@@ -2905,16 +2906,16 @@ process_command (argc, argv)
{ {
if (*endp == PATH_SEPARATOR || *endp == 0) if (*endp == PATH_SEPARATOR || *endp == 0)
{ {
strncpy (nstore, startp, endp-startp); strncpy (nstore, startp, endp - startp);
if (endp == startp) if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR)); strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
else if (!IS_DIR_SEPARATOR (endp[-1])) else if (!IS_DIR_SEPARATOR (endp[-1]))
{ {
nstore[endp-startp] = DIR_SEPARATOR; nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0; nstore[endp - startp + 1] = 0;
} }
else else
nstore[endp-startp] = 0; nstore[endp - startp] = 0;
add_prefix (&exec_prefixes, nstore, 0, add_prefix (&exec_prefixes, nstore, 0,
PREFIX_PRIORITY_LAST, 0, NULL_PTR); PREFIX_PRIORITY_LAST, 0, NULL_PTR);
add_prefix (&include_prefixes, add_prefix (&include_prefixes,
...@@ -2940,16 +2941,16 @@ process_command (argc, argv) ...@@ -2940,16 +2941,16 @@ process_command (argc, argv)
{ {
if (*endp == PATH_SEPARATOR || *endp == 0) if (*endp == PATH_SEPARATOR || *endp == 0)
{ {
strncpy (nstore, startp, endp-startp); strncpy (nstore, startp, endp - startp);
if (endp == startp) if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR)); strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
else if (!IS_DIR_SEPARATOR (endp[-1])) else if (!IS_DIR_SEPARATOR (endp[-1]))
{ {
nstore[endp-startp] = DIR_SEPARATOR; nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0; nstore[endp - startp + 1] = 0;
} }
else else
nstore[endp-startp] = 0; nstore[endp - startp] = 0;
add_prefix (&startfile_prefixes, nstore, NULL_PTR, add_prefix (&startfile_prefixes, nstore, NULL_PTR,
PREFIX_PRIORITY_LAST, 0, NULL_PTR); PREFIX_PRIORITY_LAST, 0, NULL_PTR);
if (*endp == 0) if (*endp == 0)
...@@ -2973,16 +2974,16 @@ process_command (argc, argv) ...@@ -2973,16 +2974,16 @@ process_command (argc, argv)
{ {
if (*endp == PATH_SEPARATOR || *endp == 0) if (*endp == PATH_SEPARATOR || *endp == 0)
{ {
strncpy (nstore, startp, endp-startp); strncpy (nstore, startp, endp - startp);
if (endp == startp) if (endp == startp)
strcpy (nstore, concat (".", dir_separator_str, NULL_PTR)); strcpy (nstore, concat (".", dir_separator_str, NULL_PTR));
else if (!IS_DIR_SEPARATOR (endp[-1])) else if (!IS_DIR_SEPARATOR (endp[-1]))
{ {
nstore[endp-startp] = DIR_SEPARATOR; nstore[endp - startp] = DIR_SEPARATOR;
nstore[endp-startp+1] = 0; nstore[endp - startp + 1] = 0;
} }
else else
nstore[endp-startp] = 0; nstore[endp - startp] = 0;
add_prefix (&startfile_prefixes, nstore, NULL_PTR, add_prefix (&startfile_prefixes, nstore, NULL_PTR,
PREFIX_PRIORITY_LAST, 0, NULL_PTR); PREFIX_PRIORITY_LAST, 0, NULL_PTR);
if (*endp == 0) if (*endp == 0)
...@@ -3138,7 +3139,7 @@ process_command (argc, argv) ...@@ -3138,7 +3139,7 @@ process_command (argc, argv)
fatal ("argument to `-specs=' is missing"); fatal ("argument to `-specs=' is missing");
user->next = (struct user_specs *) 0; user->next = (struct user_specs *) 0;
user->filename = argv[i]+7; user->filename = argv[i] + 7;
if (user_specs_tail) if (user_specs_tail)
user_specs_tail->next = user; user_specs_tail->next = user;
else else
...@@ -3305,7 +3306,7 @@ process_command (argc, argv) ...@@ -3305,7 +3306,7 @@ process_command (argc, argv)
#endif #endif
#if defined(HAVE_EXECUTABLE_SUFFIX) || defined(HAVE_OBJECT_SUFFIX) #if defined(HAVE_EXECUTABLE_SUFFIX) || defined(HAVE_OBJECT_SUFFIX)
if (p[1] == 0) if (p[1] == 0)
argv[i+1] = convert_filename (argv[i+1], ! have_c); argv[i + 1] = convert_filename (argv[i + 1], ! have_c);
else else
argv[i] = convert_filename (argv[i], ! have_c); argv[i] = convert_filename (argv[i], ! have_c);
#endif #endif
...@@ -3927,7 +3928,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -3927,7 +3928,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
{ {
const char *q = p; const char *q = p;
char *buf; char *buf;
while (*p != 0 && *p != '\n') p++; while (*p != 0 && *p != '\n')
p++;
buf = (char *) alloca (p - q + 1); buf = (char *) alloca (p - q + 1);
strncpy (buf, q, p - q); strncpy (buf, q, p - q);
buf[p - q] = 0; buf[p - q] = 0;
...@@ -4272,8 +4274,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4272,8 +4274,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
*x++ = *y++; *x++ = *y++;
if (*y != '_' if (*y != '_'
|| (*(y+1) != '_' || (*(y + 1) != '_'
&& ! ISUPPER ((unsigned char) *(y+1)))) && ! ISUPPER ((unsigned char) *(y + 1))))
{ {
/* Stick __ at front of macro name. */ /* Stick __ at front of macro name. */
if (*y != '_') if (*y != '_')
...@@ -4320,8 +4322,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4320,8 +4322,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
y += 2; y += 2;
if (*y != '_' if (*y != '_'
|| (*(y+1) != '_' || (*(y + 1) != '_'
&& ! ISUPPER ((unsigned char) *(y+1)))) && ! ISUPPER ((unsigned char) *(y + 1))))
{ {
/* Stick -D__ at front of macro name. */ /* Stick -D__ at front of macro name. */
*x++ = '-'; *x++ = '-';
...@@ -4468,7 +4470,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4468,7 +4470,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
flag = 1; flag = 1;
continue; continue;
} }
else if (flag && (*y == ' ' || *y == '\t' || *y == '=' else if (flag
&& (*y == ' ' || *y == '\t' || *y == '='
|| *y == '}' || *y == 0)) || *y == '}' || *y == 0))
{ {
*x++ = '_'; *x++ = '_';
...@@ -4573,7 +4576,8 @@ do_spec_1 (spec, inswitch, soft_matched_part) ...@@ -4573,7 +4576,8 @@ do_spec_1 (spec, inswitch, soft_matched_part)
arg_going = 1; arg_going = 1;
} }
return 0; /* End of string */ /* End of string. */
return 0;
} }
/* Return 0 if we call do_spec_1 and that returns -1. */ /* Return 0 if we call do_spec_1 and that returns -1. */
...@@ -4639,7 +4643,8 @@ next_member: ...@@ -4639,7 +4643,8 @@ next_member:
} }
filter = p; filter = p;
while (*p != ':' && *p != '}' && *p != '|') p++; while (*p != ':' && *p != '}' && *p != '|')
p++;
if (*p == '|' && pipe_p) if (*p == '|' && pipe_p)
abort (); abort ();
...@@ -4651,7 +4656,8 @@ next_member: ...@@ -4651,7 +4656,8 @@ next_member:
register int count = 1; register int count = 1;
register const char *q = p; register const char *q = p;
while (*q++ != ':') continue; while (*q++ != ':')
continue;
body = q; body = q;
while (count > 0) while (count > 0)
...@@ -4667,13 +4673,13 @@ next_member: ...@@ -4667,13 +4673,13 @@ next_member:
endbody = q; endbody = q;
} }
else else
body = p, endbody = p+1; body = p, endbody = p + 1;
} }
if (suffix) if (suffix)
{ {
int found = (input_suffix != 0 int found = (input_suffix != 0
&& (long) strlen (input_suffix) == (long)(p - filter) && (long) strlen (input_suffix) == (long) (p - filter)
&& strncmp (input_suffix, filter, p - filter) == 0); && strncmp (input_suffix, filter, p - filter) == 0);
if (body[0] == '}') if (body[0] == '}')
...@@ -5031,7 +5037,8 @@ set_input (filename) ...@@ -5031,7 +5037,8 @@ set_input (filename)
basename_length = strlen (input_basename); basename_length = strlen (input_basename);
suffixed_basename_length = basename_length; suffixed_basename_length = basename_length;
p = input_basename + basename_length; p = input_basename + basename_length;
while (p != input_basename && *p != '.') --p; while (p != input_basename && *p != '.')
--p;
if (*p == '.' && p != input_basename) if (*p == '.' && p != input_basename)
{ {
basename_length = p - input_basename; basename_length = p - input_basename;
...@@ -5150,8 +5157,8 @@ main (argc, argv) ...@@ -5150,8 +5157,8 @@ main (argc, argv)
needed for collect. We use argv[0] instead of programname because needed for collect. We use argv[0] instead of programname because
we need the complete pathname. */ we need the complete pathname. */
obstack_init (&collect_obstack); obstack_init (&collect_obstack);
obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=")-1); obstack_grow (&collect_obstack, "COLLECT_GCC=", sizeof ("COLLECT_GCC=") - 1);
obstack_grow (&collect_obstack, argv[0], strlen (argv[0])+1); obstack_grow (&collect_obstack, argv[0], strlen (argv[0]) + 1);
putenv (obstack_finish (&collect_obstack)); putenv (obstack_finish (&collect_obstack));
#ifdef INIT_ENVIRONMENT #ifdef INIT_ENVIRONMENT
...@@ -5171,10 +5178,10 @@ main (argc, argv) ...@@ -5171,10 +5178,10 @@ main (argc, argv)
/* Build COLLECT_GCC_OPTIONS to have all of the options specified to /* Build COLLECT_GCC_OPTIONS to have all of the options specified to
the compiler. */ the compiler. */
obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=", obstack_grow (&collect_obstack, "COLLECT_GCC_OPTIONS=",
sizeof ("COLLECT_GCC_OPTIONS=")-1); sizeof ("COLLECT_GCC_OPTIONS=") - 1);
first_time = TRUE; first_time = TRUE;
for (i = 0; (int)i < n_switches; i++) for (i = 0; (int) i < n_switches; i++)
{ {
const char *const *args; const char *const *args;
const char *p, *q; const char *p, *q;
...@@ -5184,9 +5191,9 @@ main (argc, argv) ...@@ -5184,9 +5191,9 @@ main (argc, argv)
first_time = FALSE; first_time = FALSE;
obstack_grow (&collect_obstack, "'-", 2); obstack_grow (&collect_obstack, "'-", 2);
q = switches[i].part1; q = switches[i].part1;
while ((p = index (q,'\''))) while ((p = index (q, '\'')))
{ {
obstack_grow (&collect_obstack, q, p-q); obstack_grow (&collect_obstack, q, p - q);
obstack_grow (&collect_obstack, "'\\''", 4); obstack_grow (&collect_obstack, "'\\''", 4);
q = ++p; q = ++p;
} }
...@@ -5197,9 +5204,9 @@ main (argc, argv) ...@@ -5197,9 +5204,9 @@ main (argc, argv)
{ {
obstack_grow (&collect_obstack, " '", 2); obstack_grow (&collect_obstack, " '", 2);
q = *args; q = *args;
while ((p = index (q,'\''))) while ((p = index (q, '\'')))
{ {
obstack_grow (&collect_obstack, q, p-q); obstack_grow (&collect_obstack, q, p - q);
obstack_grow (&collect_obstack, "'\\''", 4); obstack_grow (&collect_obstack, "'\\''", 4);
q = ++p; q = ++p;
} }
...@@ -5321,7 +5328,7 @@ main (argc, argv) ...@@ -5321,7 +5328,7 @@ main (argc, argv)
/* If we have a GCC_EXEC_PREFIX envvar, modify it for cpp's sake. */ /* If we have a GCC_EXEC_PREFIX envvar, modify it for cpp's sake. */
if (gcc_exec_prefix) if (gcc_exec_prefix)
{ {
char * temp = (char *) xmalloc (strlen (gcc_exec_prefix) char *temp = (char *) xmalloc (strlen (gcc_exec_prefix)
+ strlen (spec_version) + strlen (spec_version)
+ strlen (spec_machine) + 3); + strlen (spec_machine) + 3);
strcpy (temp, gcc_exec_prefix); strcpy (temp, gcc_exec_prefix);
...@@ -5343,7 +5350,7 @@ main (argc, argv) ...@@ -5343,7 +5350,7 @@ main (argc, argv)
/* Warn about any switches that no pass was interested in. */ /* Warn about any switches that no pass was interested in. */
for (i = 0; (int)i < n_switches; i++) for (i = 0; (int) i < n_switches; i++)
if (! switches[i].validated) if (! switches[i].validated)
error ("unrecognized option `-%s'", switches[i].part1); error ("unrecognized option `-%s'", switches[i].part1);
...@@ -5438,7 +5445,7 @@ main (argc, argv) ...@@ -5438,7 +5445,7 @@ main (argc, argv)
explicit_link_files = xcalloc (1, n_infiles); explicit_link_files = xcalloc (1, n_infiles);
for (i = 0; (int)i < n_infiles; i++) for (i = 0; (int) i < n_infiles; i++)
{ {
register struct compiler *cp = 0; register struct compiler *cp = 0;
int this_file_error = 0; int this_file_error = 0;
...@@ -5530,7 +5537,7 @@ main (argc, argv) ...@@ -5530,7 +5537,7 @@ main (argc, argv)
complain about input files to be given to the linker. */ complain about input files to be given to the linker. */
if (! linker_was_run && error_count == 0) if (! linker_was_run && error_count == 0)
for (i = 0; (int)i < n_infiles; i++) for (i = 0; (int) i < n_infiles; i++)
if (explicit_link_files[i]) if (explicit_link_files[i])
error ("%s: linker input file unused since linking not done", error ("%s: linker input file unused since linking not done",
outfiles[i]); outfiles[i]);
...@@ -5762,7 +5769,7 @@ validate_all_switches () ...@@ -5762,7 +5769,7 @@ validate_all_switches ()
} }
/* Look through the linked list of specs read from the specs file. */ /* Look through the linked list of specs read from the specs file. */
for (spec = specs; spec ; spec = spec->next) for (spec = specs; spec; spec = spec->next)
{ {
p = *(spec->ptr_spec); p = *(spec->ptr_spec);
while ((c = *p++)) while ((c = *p++))
...@@ -5800,7 +5807,8 @@ validate_switches (start) ...@@ -5800,7 +5807,8 @@ validate_switches (start)
suffix = 1, ++p; suffix = 1, ++p;
filter = p; filter = p;
while (*p != ':' && *p != '}') p++; while (*p != ':' && *p != '}')
p++;
if (suffix) if (suffix)
; ;
...@@ -5850,13 +5858,14 @@ used_arg (p, len) ...@@ -5850,13 +5858,14 @@ used_arg (p, len)
const char *q; const char *q;
int cnt = 0; int cnt = 0;
/* Break multilib_matches into the component strings of string and replacement /* Break multilib_matches into the component strings of string
string. */ and replacement string. */
for (q = multilib_matches; *q != '\0'; q++) for (q = multilib_matches; *q != '\0'; q++)
if (*q == ';') if (*q == ';')
cnt++; cnt++;
matches = (struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt); matches =
(struct mswitchstr *) alloca ((sizeof (struct mswitchstr)) * cnt);
i = 0; i = 0;
q = multilib_matches; q = multilib_matches;
while (*q != '\0') while (*q != '\0')
...@@ -5921,7 +5930,7 @@ default_arg (p, len) ...@@ -5921,7 +5930,7 @@ default_arg (p, len)
{ {
const char *start, *end; const char *start, *end;
for (start = multilib_defaults; *start != '\0'; start = end+1) for (start = multilib_defaults; *start != '\0'; start = end + 1)
{ {
while (*start == ' ' || *start == '\t') while (*start == ' ' || *start == '\t')
start++; start++;
...@@ -5929,7 +5938,7 @@ default_arg (p, len) ...@@ -5929,7 +5938,7 @@ default_arg (p, len)
if (*start == '\0') if (*start == '\0')
break; break;
for (end = start+1; *end != ' ' && *end != '\t' && *end != '\0'; end++) for (end = start + 1; *end != ' ' && *end != '\t' && *end != '\0'; end++)
; ;
if ((end - start) == len && strncmp (p, start, len) == 0) if ((end - start) == len && strncmp (p, start, len) == 0)
...@@ -6088,7 +6097,7 @@ set_multilib_dir () ...@@ -6088,7 +6097,7 @@ set_multilib_dir ()
if (this_path_len != 1 if (this_path_len != 1
|| this_path[0] != '.') || this_path[0] != '.')
{ {
char * new_multilib_dir = xmalloc (this_path_len + 1); char *new_multilib_dir = xmalloc (this_path_len + 1);
strncpy (new_multilib_dir, this_path, this_path_len); strncpy (new_multilib_dir, this_path, this_path_len);
new_multilib_dir[this_path_len] = '\0'; new_multilib_dir[this_path_len] = '\0';
multilib_dir = new_multilib_dir; multilib_dir = new_multilib_dir;
...@@ -6228,7 +6237,7 @@ print_multilib_info () ...@@ -6228,7 +6237,7 @@ print_multilib_info ()
if (! skip) if (! skip)
{ {
/* If this is a duplicate, skip it. */ /* If this is a duplicate, skip it. */
skip = (last_path != 0 && (unsigned int)(p - this_path) == last_path_len skip = (last_path != 0 && (unsigned int) (p - this_path) == last_path_len
&& ! strncmp (last_path, this_path, last_path_len)); && ! strncmp (last_path, this_path, last_path_len));
last_path = this_path; last_path = this_path;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment