aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppspec.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-09-13 03:57:40 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-09-13 03:57:40 +0000
commit9257393c20357f1f5c454d252da8089dcc22c1fd (patch)
tree6e552cd6afac414afba22bf962c7bef94bf8e7f5 /gcc/cppspec.c
parent5d73aa6323d0795b477d1725ed9e62fcb7e9494c (diff)
downloadgcc-9257393c20357f1f5c454d252da8089dcc22c1fd.zip
gcc-9257393c20357f1f5c454d252da8089dcc22c1fd.tar.gz
gcc-9257393c20357f1f5c454d252da8089dcc22c1fd.tar.bz2
Makefile.in (gcc.o, [...]): Depend on gcc.h.
* 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'. From-SVN: r29367
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 0127305..f9a632f 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. */