aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-08-02 20:21:27 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-08-02 20:21:27 +0000
commit37620334d9357703c406caff5f6255fa59f83421 (patch)
treefd152d55cc2977cce93eb949677f8ea99866bf67 /gcc/gcc.c
parentf9427d170488c89fc8f2f4eed47b7feca4b32296 (diff)
downloadgcc-37620334d9357703c406caff5f6255fa59f83421.zip
gcc-37620334d9357703c406caff5f6255fa59f83421.tar.gz
gcc-37620334d9357703c406caff5f6255fa59f83421.tar.bz2
gcc.h (lang_specific_driver): Constify second argument.
* gcc.h (lang_specific_driver): Constify second argument. * gcc.c (translate_options, process_command, main): Likewise. Constify variables to match. Cast second argument to pexecute. * cppspec.c, gccspec.c, g++spec.c, g77spec.c, jvspec.c: Adjust type of second argument to lang_specific_driver, and update code as necessary. From-SVN: r35433
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 5f61be2..57c75da 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -210,7 +210,7 @@ static int access_check PARAMS ((const char *, int));
static char *find_a_file PARAMS ((struct path_prefix *, const char *, int));
static void add_prefix PARAMS ((struct path_prefix *, const char *,
const char *, int, int, int *));
-static void translate_options PARAMS ((int *, const char ***));
+static void translate_options PARAMS ((int *, const char *const **));
static char *skip_whitespace PARAMS ((char *));
static void record_temp_file PARAMS ((const char *, int, int));
static void delete_if_ordinary PARAMS ((const char *));
@@ -242,7 +242,7 @@ static void display_help PARAMS ((void));
static void add_preprocessor_option PARAMS ((const char *, int));
static void add_assembler_option PARAMS ((const char *, int));
static void add_linker_option PARAMS ((const char *, int));
-static void process_command PARAMS ((int, const char **));
+static void process_command PARAMS ((int, const char *const *));
static int execute PARAMS ((void));
static void unused_prefix_warnings PARAMS ((struct path_prefix *));
static void clear_args PARAMS ((void));
@@ -854,11 +854,11 @@ struct option_map option_map[] =
static void
translate_options (argcp, argvp)
int *argcp;
- const char ***argvp;
+ const char *const **argvp;
{
int i;
int argc = *argcp;
- const char **argv = *argvp;
+ const char *const *argv = *argvp;
const char **newv =
(const char **) xmalloc ((argc + 2) * 2 * sizeof (const char *));
int newindex = 0;
@@ -2492,7 +2492,7 @@ execute ()
/* Print each piped command as a separate line. */
for (i = 0; i < n_commands ; i++)
{
- const char **j;
+ const char *const *j;
for (j = commands[i].argv; *j; j++)
fprintf (stderr, " %s", *j);
@@ -2523,7 +2523,9 @@ execute ()
char *errmsg_fmt, *errmsg_arg;
const char *string = commands[i].argv[0];
- commands[i].pid = pexecute (string, commands[i].argv,
+ /* For some bizarre reason, the second argument of execvp() is
+ char *const *, not const char *const *. */
+ commands[i].pid = pexecute (string, (char *const *) commands[i].argv,
programname, temp_filename,
&errmsg_fmt, &errmsg_arg,
((i == 0 ? PEXECUTE_FIRST : 0)
@@ -2860,7 +2862,7 @@ add_linker_option (option, len)
static void
process_command (argc, argv)
int argc;
- const char **argv;
+ const char *const *argv;
{
register int i;
const char *temp;
@@ -5088,12 +5090,12 @@ fatal_error (signum)
kill (getpid (), signum);
}
-extern int main PARAMS ((int, char **));
+extern int main PARAMS ((int, const char *const *));
int
main (argc, argv)
int argc;
- char **argv;
+ const char *const *argv;
{
size_t i;
int value;
@@ -5213,7 +5215,7 @@ main (argc, argv)
first_time = TRUE;
for (i = 0; (int)i < n_switches; i++)
{
- const char **args;
+ const char *const *args;
const char *p, *q;
if (!first_time)
obstack_grow (&collect_obstack, " ", 1);