aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-11-27 10:09:17 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-11-27 10:09:17 +0000
commit2778b98d9088057e96730a5a4f314d9d57bedc65 (patch)
tree34ccf49c3a33a630b8aabf80bc4b9c4bd0db64b8 /gcc/gcc.c
parent3081a3ada689c56e5a8c348aac90dfe7f00122bd (diff)
downloadgcc-2778b98d9088057e96730a5a4f314d9d57bedc65.zip
gcc-2778b98d9088057e96730a5a4f314d9d57bedc65.tar.gz
gcc-2778b98d9088057e96730a5a4f314d9d57bedc65.tar.bz2
system.h: Include libiberty.h.
* system.h: Include libiberty.h. * c-aux-info.c: Remove prototypes for concat/concat3. Change function `concat' from fixed parameters to variable parameters, as is done in libiberty. All callers of concat/concat3 changed to use the new `concat' with variable args. * cccp.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * cexp.y: Likewise. * collect2.c: Likewise. * config/1750a/1750a.h: Likewise. * cppalloc.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * dyn-string.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencheck.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * gengenrtl.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * getpwd.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes in NEED_DECLARATION_* macros. * mips-tfile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. (fatal): Fix const-ification of variable `format' in !ANSI_PROTOTYPES case. * prefix.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid conflicting with function `spaces' from libiberty. * profile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * protoize.c: Likewise. * rtl.h: Likewise. * scan.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.h: Likewise. From-SVN: r23931
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c82
1 files changed, 7 insertions, 75 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 6f3ed84..8521665 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -38,18 +38,9 @@ compilation is specified by a string called a "spec". */
#include "obstack.h"
-
/* ??? Need to find a GCC header to put these in. */
-extern int pexecute PROTO ((const char *, char * const *, const char *,
- const char *, char **, char **, int));
-extern int pwait PROTO ((int, int *, int));
extern char *update_path PROTO((char *, char *));
extern void set_std_prefix PROTO((char *, int));
-/* Flag arguments to pexecute. */
-#define PEXECUTE_FIRST 1
-#define PEXECUTE_LAST 2
-#define PEXECUTE_SEARCH 4
-#define PEXECUTE_VERBOSE 8
#ifdef VMS
#define exit __posix_exit
@@ -195,7 +186,6 @@ 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 *concat PVPROTO((char *, ...));
extern int do_spec PROTO((char *));
static int do_spec_1 PROTO((char *, int, char *));
static char *find_file PROTO((char *));
@@ -215,8 +205,6 @@ static void error PVPROTO((char *, ...));
static void display_help PROTO((void));
void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
-char *xmalloc ();
-char *xrealloc ();
#ifdef LANG_SPECIFIC_DRIVER
/* Called before processing to change/add/remove arguments. */
@@ -1292,8 +1280,6 @@ static struct temp_name {
int filename_length; /* strlen (filename). */
struct temp_name *next;
} *temp_names;
-#else
-extern char *choose_temp_base PROTO((void));
#endif
@@ -5220,81 +5206,27 @@ lookup_compiler (name, length, language)
return 0;
}
-char *
+PTR
xmalloc (size)
- unsigned size;
+ size_t size;
{
- register char *value = (char *) malloc (size);
+ register PTR value = (PTR) malloc (size);
if (value == 0)
fatal ("virtual memory exhausted");
return value;
}
-char *
+PTR
xrealloc (ptr, size)
- char *ptr;
- unsigned size;
+ PTR ptr;
+ size_t size;
{
- register char *value = (char *) realloc (ptr, size);
+ register PTR value = (PTR) realloc (ptr, size);
if (value == 0)
fatal ("virtual memory exhausted");
return value;
}
-/* This function is based on the one in libiberty. */
-
-static char *
-concat VPROTO((char *first, ...))
-{
- register int length;
- register char *newstr;
- register char *end;
- register char *arg;
- va_list args;
-#ifndef ANSI_PROTOTYPES
- char *first;
-#endif
-
- /* First compute the size of the result and get sufficient memory. */
-
- VA_START (args, first);
-#ifndef ANSI_PROTOTYPES
- first = va_arg (args, char *);
-#endif
-
- arg = first;
- length = 0;
-
- while (arg != 0)
- {
- length += strlen (arg);
- arg = va_arg (args, char *);
- }
-
- newstr = (char *) xmalloc (length + 1);
- va_end (args);
-
- /* Now copy the individual pieces to the result string. */
-
- VA_START (args, first);
-#ifndef ANSI_PROTOTYPES
- first = va_arg (args, char *);
-#endif
-
- end = newstr;
- arg = first;
- while (arg != 0)
- {
- while (*arg)
- *end++ = *arg++;
- arg = va_arg (args, char *);
- }
- *end = '\000';
- va_end (args);
-
- return (newstr);
-}
-
static char *
save_string (s, len)
char *s;