diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-13 03:57:40 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-13 03:57:40 +0000 |
commit | 7f0b0c275fbaeae21c3257af05ed98fe64837330 (patch) | |
tree | 6e552cd6afac414afba22bf962c7bef94bf8e7f5 /gcc/cppspec.c | |
parent | 5b592939d9252a01123b7d7e35501317468fa089 (diff) | |
download | gcc-7f0b0c275fbaeae21c3257af05ed98fe64837330.tar.gz |
* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.
* gcc.h: New file.
(lang_specific_driver): Don't take a function pointer parameter.
All callers changed.
* gcc.c: Include gcc.h.
(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
lang_specific_extra_outfiles, fatal): Don't declare.
(multilib_defaults_raw): Constify.
(read_specs): Call memset, rather than bzero.
(main): Call return, not exit.
(lookup_compiler): Call memcpy, not bcopy.
(fatal): Make extern.
* cppspec.c: Include gcc.h.
(lang_specific_driver): Initialize variable `quote'. Constify a
char*. All calls to the function pointer parameter now
explicitly call `fatal'.
* gccspec.c (lang_specific_driver): Include gcc.h.
cp:
* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
xmalloc/bzero. All calls to the function pointer parameter now
explicitly call `fatal'.
f:
* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.
* g77spec.c: Include gcc.h.
(g77_xargv): Constify.
(g77_fn): Add parameter prototypes.
(lookup_option, append_arg): Add static prototypes.
(g77_newargv): Constify.
(lookup_option, append_arg, lang_specific_driver): Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
java:
* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
* jvspec.c: Include gcc.h. Don't include gansidecl.h.
(do_spec, lang_specific_pre_link, lang_specific_driver,
input_filename, input_filename_length): Don't declare.
(main_class_name, jvgenmain_spec, lang_specific_driver):
Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29367 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppspec.c')
-rw-r--r-- | gcc/cppspec.c | 20 |
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. */ |