summaryrefslogtreecommitdiff
path: root/gcc/cppspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppspec.c')
-rw-r--r--gcc/cppspec.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/cppspec.c b/gcc/cppspec.c
index 01273054005..f9a632f2433 100644
--- a/gcc/cppspec.c
+++ b/gcc/cppspec.c
@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
+#include "gcc.h"
/* The `cpp' executable installed in $(bindir) and $(cpp_install_dir)
is a customized version of the gcc driver. It forces -E; -S and -c
@@ -69,8 +70,7 @@ static const char *const known_suffixes[] =
/* Filter argc and argv before processing by the gcc driver proper. */
void
-lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
- void (*errfn) PVPROTO((const char *, ...));
+lang_specific_driver (in_argc, in_argv, in_added_libraries)
int *in_argc;
char ***in_argv;
int *in_added_libraries ATTRIBUTE_UNUSED;
@@ -99,8 +99,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
/* Do we need to fix up an input file with an unrecognized suffix? */
int need_fixups = 1;
- int i, j, quote;
- char **new_argv;
+ int i, j, quote = 0;
+ char **real_new_argv;
+ const char **new_argv;
int new_argc;
/* First pass. If we see an -S or -c, barf. If we see an input file,
@@ -124,8 +125,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
need_E = 0;
else if (argv[i][1] == 'S' || argv[i][1] == 'c')
{
- (*errfn) ("`%s' is not a legal option to the preprocessor",
- argv[i]);
+ fatal ("`%s' is not a legal option to the preprocessor",
+ argv[i]);
return;
}
else if (argv[i][1] == 'x')
@@ -148,7 +149,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
seen_input++;
if (seen_input == 3)
{
- (*errfn) ("too many input files");
+ fatal ("too many input files");
return;
}
else if (seen_input == 2)
@@ -195,7 +196,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
return;
/* One more slot for a terminating null. */
- new_argv = (char **) xmalloc ((new_argc + 1) * sizeof(char *));
+ real_new_argv = (char **) xmalloc ((new_argc + 1) * sizeof(char *));
+ new_argv = (const char **) real_new_argv.
new_argv[0] = argv[0];
j = 1;
@@ -223,7 +225,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
new_argv[j] = NULL;
*in_argc = new_argc;
- *in_argv = new_argv;
+ *in_argv = real_new_argv;
}
/* Called before linking. Returns 0 on success and -1 on failure. */