summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-05 19:11:22 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>1999-01-05 19:11:22 +0000
commit7bcdc3c72acd322469e7e757bd44f03072a93459 (patch)
treef98dde49db8ef6f1d425e196eb7db84dab10c8b4 /gcc/gcc.c
parent34f474122add99e4b033b875f2a2574dbd11e884 (diff)
downloadgcc-7bcdc3c72acd322469e7e757bd44f03072a93459.tar.gz
* Makefile.in (gcc.o, prefix.o, cccp.o, cpplib.o): Depend on prefix.h.
* cccp.c: Include prefix.h, don't prototype prefix.c functions. (new_include_prefix): Constify char* parameters. * cppfiles.c (read_name_map): Likewise. (append_include_chain): Likewise. Also, use a writable char* copy of parameter `dir' which we then modify, rather than using the parameter itself to store the new writable string. (remap_filename): Constify some variables. Also, use a writable char* to store an allocated string which we will be modifying. * cpplib.c: Include prefix.h, don't prototype prefix.c functions. (cpp_start_read): Constify variable `str'. * cpplib.h (append_include_chain): Constify a char* parameter. * gcc.c Include prefix.h, don't prototype prefix.c functions. (add_prefix, save_string): Constify char* parameters. (fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes. * prefix.c: Include prefix.h. (get_key_value, translate_name, save_string, update_path, set_std_prefix): Constify various char* parameters and variables. (save_string): Use xmalloc, not malloc. (translate_name): Use a writable temporary variable to create and modify a string before setting it to a const char*. * prefix.h: New file to prototype functions exported from prefix.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24498 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index cda78b6dd93..854ed2395a6 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -36,10 +36,7 @@ compilation is specified by a string called a "spec". */
#include <signal.h>
#include "obstack.h"
-
-/* ??? Need to find a GCC header to put these in. */
-extern char *update_path PROTO((char *, char *));
-extern void set_std_prefix PROTO((char *, int));
+#include "prefix.h"
#ifdef VMS
#define exit __posix_exit
@@ -174,8 +171,8 @@ static struct compiler *lookup_compiler PROTO((char *, size_t, char *));
static char *build_search_list PROTO((struct path_prefix *, char *, int));
static void putenv_from_prefixes PROTO((struct path_prefix *, char *));
static char *find_a_file PROTO((struct path_prefix *, char *, int));
-static void add_prefix PROTO((struct path_prefix *, char *, char *,
- int, int, int *));
+static void add_prefix PROTO((struct path_prefix *, const char *,
+ const char *, int, int, int *));
static char *skip_whitespace PROTO((char *));
static void record_temp_file PROTO((char *, int, int));
static void delete_if_ordinary PROTO((char *));
@@ -184,7 +181,7 @@ static void delete_failure_queue PROTO((void));
static void clear_failure_queue PROTO((void));
static int check_live_switch PROTO((int, int));
static char *handle_braces PROTO((char *));
-static char *save_string PROTO((char *, int));
+static char *save_string PROTO((const char *, int));
extern int do_spec PROTO((char *));
static int do_spec_1 PROTO((char *, int, char *));
static char *find_file PROTO((char *));
@@ -199,8 +196,9 @@ static void print_multilib_info PROTO((void));
static void pfatal_with_name PROTO((char *)) ATTRIBUTE_NORETURN;
static void perror_with_name PROTO((char *));
static void pfatal_pexecute PROTO((char *, char *)) ATTRIBUTE_NORETURN;
-static void fatal PVPROTO((char *, ...)) ATTRIBUTE_NORETURN;
-static void error PVPROTO((char *, ...));
+static void fatal PVPROTO((char *, ...))
+ ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_1;
+static void error PVPROTO((char *, ...)) ATTRIBUTE_PRINTF_1;
static void display_help PROTO((void));
void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -2101,8 +2099,8 @@ find_a_file (pprefix, name, mode)
static void
add_prefix (pprefix, prefix, component, first, require_machine_suffix, warn)
struct path_prefix *pprefix;
- char *prefix;
- char *component;
+ const char *prefix;
+ const char *component;
int first;
int require_machine_suffix;
int *warn;
@@ -5233,8 +5231,8 @@ xrealloc (ptr, size)
static char *
save_string (s, len)
- char *s;
- int len;
+ const char *s;
+ int len;
{
register char *result = xmalloc (len + 1);