system.h: Include libiberty.h.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Fri, 27 Nov 1998 10:09:17 +0000 (10:09 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Fri, 27 Nov 1998 10:09:17 +0000 (10:09 +0000)
        * 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

45 files changed:
gcc/ChangeLog
gcc/c-aux-info.c
gcc/cccp.c
gcc/cexp.c
gcc/cexp.y
gcc/collect2.c
gcc/config/1750a/1750a.h
gcc/cppalloc.c
gcc/cppexp.c
gcc/cppfiles.c
gcc/cpphash.c
gcc/cpplib.c
gcc/dyn-string.c
gcc/fix-header.c
gcc/gcc.c
gcc/gcov.c
gcc/genattr.c
gcc/genattrtab.c
gcc/gencheck.c
gcc/gencodes.c
gcc/genconfig.c
gcc/genemit.c
gcc/genextract.c
gcc/genflags.c
gcc/gengenrtl.c
gcc/genopinit.c
gcc/genoutput.c
gcc/genpeep.c
gcc/genrecog.c
gcc/getpwd.c
gcc/halfpic.c
gcc/hash.c
gcc/mips-tdump.c
gcc/mips-tfile.c
gcc/prefix.c
gcc/print-rtl.c
gcc/profile.c
gcc/protoize.c
gcc/rtl.h
gcc/scan.h
gcc/system.h
gcc/tlink.c
gcc/toplev.c
gcc/toplev.h
gcc/tree.h

index ef22399691b7b5c710f22a0bd1913d85a939c413..865ebfcb5571d37181fc39fcbb60c289af3a8614 100644 (file)
@@ -1,3 +1,66 @@
+Fri Nov 27 12:28:56 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * 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.
+
 Thu Nov 26 08:38:06 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * cppfiles.c (simplify_pathname): Un-ANSI-fy function definition.
index 1125d5a10fe6bdb7326a19836ca9f5e63f01ed4d..e6737c995dc856632d45c85209ecc122031eec07 100644 (file)
@@ -37,8 +37,6 @@ typedef enum formals_style_enum formals_style;
 
 static char *data_type;
 
-static char *concat                    PROTO((char *, char *));
-static char *concat3                   PROTO((char *, char *, char *));
 static char *affix_data_type           PROTO((char *));
 static char *gen_formal_list_for_type  PROTO((tree, formals_style));
 static int   deserves_ellipsis         PROTO((tree));
@@ -46,55 +44,60 @@ static char *gen_formal_list_for_func_def PROTO((tree, formals_style));
 static char *gen_type                  PROTO((char *, tree, formals_style));
 static char *gen_decl                  PROTO((tree, int, formals_style));
 \f
-/*  Take two strings and mash them together into a newly allocated area.  */
+/* Concatenate a sequence of strings, returning the result.
 
-static char *
-concat (s1, s2)
-     char *s1;
-     char *s2;
+   This function is based on the one in libiberty.  */
+
+char *
+concat VPROTO((const char *first, ...))
 {
-  int size1, size2;
-  char *ret_val;
+  register int length;
+  register char *newstr;
+  register char *end;
+  register const char *arg;
+  va_list args;
+#ifndef ANSI_PROTOTYPES
+  const 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, const char *);
+#endif
+
+  arg = first;
+  length = 0;
+
+  while (arg != 0)
+    {
+      length += strlen (arg);
+      arg = va_arg (args, const char *);
+    }
 
-  if (!s1)
-    s1 = "";
-  if (!s2)
-    s2 = "";
+  newstr = (char *) malloc (length + 1);
+  va_end (args);
 
-  size1 = strlen (s1);
-  size2 = strlen (s2);
-  ret_val = xmalloc (size1 + size2 + 1);
-  strcpy (ret_val, s1);
-  strcpy (&ret_val[size1], s2);
-  return ret_val;
-}
+  /* Now copy the individual pieces to the result string.  */
 
-/*  Take three strings and mash them together into a newly allocated area.  */
+  VA_START (args, first);
+#ifndef ANSI_PROTOTYPES
+  first = va_arg (args, char *);
+#endif
 
-static char *
-concat3 (s1, s2, s3)
-     char *s1;
-     char *s2;
-     char *s3;
-{
-  int size1, size2, size3;
-  char *ret_val;
+  end = newstr;
+  arg = first;
+  while (arg != 0)
+    {
+      while (*arg)
+       *end++ = *arg++;
+      arg = va_arg (args, const char *);
+    }
+  *end = '\000';
+  va_end (args);
 
-  if (!s1)
-    s1 = "";
-  if (!s2)
-    s2 = "";
-  if (!s3)
-    s3 = "";
-
-  size1 = strlen (s1);
-  size2 = strlen (s2);
-  size3 = strlen (s3);
-  ret_val = xmalloc (size1 + size2 + size3 + 1);
-  strcpy (ret_val, s1);
-  strcpy (&ret_val[size1], s2);
-  strcpy (&ret_val[size1+size2], s3);
-  return ret_val;
+  return (newstr);
 }
 
 /* Given a string representing an entire type or an entire declaration
@@ -140,13 +143,13 @@ affix_data_type (type_or_decl)
      add a blank after the data-type of course.  */
 
   if (p == type_or_decl)
-    return concat3 (data_type, " ", type_or_decl);
+    return concat (data_type, " ", type_or_decl, NULL_PTR);
 
   saved = *p;
   *p = '\0';
-  qualifiers_then_data_type = concat (type_or_decl, data_type);
+  qualifiers_then_data_type = concat (type_or_decl, data_type, NULL_PTR);
   *p = saved;
-  return concat3 (qualifiers_then_data_type, " ", p);
+  return concat (qualifiers_then_data_type, " ", p, NULL_PTR);
 }
 
 /* Given a tree node which represents some "function type", generate the
@@ -173,13 +176,13 @@ gen_formal_list_for_type (fntype, style)
       char *this_type;
 
       if (*formal_list)
-        formal_list = concat (formal_list, ", ");
+        formal_list = concat (formal_list, ", ", NULL_PTR);
 
       this_type = gen_type ("", TREE_VALUE (formal_type), ansi);
       formal_list
        = ((strlen (this_type))
-          ? concat (formal_list, affix_data_type (this_type))
-          : concat (formal_list, data_type));
+          ? concat (formal_list, affix_data_type (this_type), NULL_PTR)
+          : concat (formal_list, data_type, NULL_PTR));
 
       formal_type = TREE_CHAIN (formal_type);
     }
@@ -228,10 +231,10 @@ gen_formal_list_for_type (fntype, style)
          petered out to a NULL (i.e. without being terminated by a
          void_type_node) then we need to tack on an ellipsis.  */
       if (!formal_type)
-        formal_list = concat (formal_list, ", ...");
+        formal_list = concat (formal_list, ", ...", NULL_PTR);
     }
 
-  return concat3 (" (", formal_list, ")");
+  return concat (" (", formal_list, ")", NULL_PTR);
 }
 
 /* For the generation of an ANSI prototype for a function definition, we have
@@ -290,23 +293,23 @@ gen_formal_list_for_func_def (fndecl, style)
       char *this_formal;
 
       if (*formal_list && ((style == ansi) || (style == k_and_r_names)))
-        formal_list = concat (formal_list, ", ");
+        formal_list = concat (formal_list, ", ", NULL_PTR);
       this_formal = gen_decl (formal_decl, 0, style);
       if (style == k_and_r_decls)
-        formal_list = concat3 (formal_list, this_formal, "; ");
+        formal_list = concat (formal_list, this_formal, "; ", NULL_PTR);
       else
-        formal_list = concat (formal_list, this_formal);
+        formal_list = concat (formal_list, this_formal, NULL_PTR);
       formal_decl = TREE_CHAIN (formal_decl);
     }
   if (style == ansi)
     {
       if (!DECL_ARGUMENTS (fndecl))
-        formal_list = concat (formal_list, "void");
+        formal_list = concat (formal_list, "void", NULL_PTR);
       if (deserves_ellipsis (TREE_TYPE (fndecl)))
-        formal_list = concat (formal_list, ", ...");
+        formal_list = concat (formal_list, ", ...", NULL_PTR);
     }
   if ((style == ansi) || (style == k_and_r_names))
-    formal_list = concat3 (" (", formal_list, ")");
+    formal_list = concat (" (", formal_list, ")", NULL_PTR);
   return formal_list;
 }
 
@@ -368,14 +371,14 @@ gen_type (ret_val, t, style)
         {
         case POINTER_TYPE:
           if (TYPE_READONLY (t))
-            ret_val = concat ("const ", ret_val);
+            ret_val = concat ("const ", ret_val, NULL_PTR);
           if (TYPE_VOLATILE (t))
-            ret_val = concat ("volatile ", ret_val);
+            ret_val = concat ("volatile ", ret_val, NULL_PTR);
 
-          ret_val = concat ("*", ret_val);
+          ret_val = concat ("*", ret_val, NULL_PTR);
 
          if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
-           ret_val = concat3 ("(", ret_val, ")");
+           ret_val = concat ("(", ret_val, ")", NULL_PTR);
 
           ret_val = gen_type (ret_val, TREE_TYPE (t), style);
 
@@ -383,21 +386,26 @@ gen_type (ret_val, t, style)
 
         case ARRAY_TYPE:
          if (TYPE_SIZE (t) == 0 || TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST)
-           ret_val = gen_type (concat (ret_val, "[]"), TREE_TYPE (t), style);
+           ret_val = gen_type (concat (ret_val, "[]", NULL_PTR),
+                               TREE_TYPE (t), style);
          else if (int_size_in_bytes (t) == 0)
-           ret_val = gen_type (concat (ret_val, "[0]"), TREE_TYPE (t), style);
+           ret_val = gen_type (concat (ret_val, "[0]", NULL_PTR),
+                               TREE_TYPE (t), style);
          else
            {
              int size = (int_size_in_bytes (t) / int_size_in_bytes (TREE_TYPE (t)));
              char buff[10];
              sprintf (buff, "[%d]", size);
-             ret_val = gen_type (concat (ret_val, buff),
+             ret_val = gen_type (concat (ret_val, buff, NULL_PTR),
                                  TREE_TYPE (t), style);
            }
           break;
 
         case FUNCTION_TYPE:
-          ret_val = gen_type (concat (ret_val, gen_formal_list_for_type (t, style)), TREE_TYPE (t), style);
+          ret_val = gen_type (concat (ret_val,
+                                     gen_formal_list_for_type (t, style),
+                                     NULL_PTR),
+                             TREE_TYPE (t), style);
           break;
 
         case IDENTIFIER_NODE:
@@ -424,13 +432,14 @@ gen_type (ret_val, t, style)
              chain_p = TYPE_FIELDS (t);
              while (chain_p)
                {
-                 data_type = concat (data_type, gen_decl (chain_p, 0, ansi));
+                 data_type = concat (data_type, gen_decl (chain_p, 0, ansi),
+                                     NULL_PTR);
                  chain_p = TREE_CHAIN (chain_p);
-                 data_type = concat (data_type, "; ");
+                 data_type = concat (data_type, "; ", NULL_PTR);
                }
-             data_type = concat3 ("{ ", data_type, "}");
+             data_type = concat ("{ ", data_type, "}", NULL_PTR);
            }
-         data_type = concat ("struct ", data_type);
+         data_type = concat ("struct ", data_type, NULL_PTR);
          break;
 
         case UNION_TYPE:
@@ -442,13 +451,14 @@ gen_type (ret_val, t, style)
              chain_p = TYPE_FIELDS (t);
              while (chain_p)
                {
-                 data_type = concat (data_type, gen_decl (chain_p, 0, ansi));
+                 data_type = concat (data_type, gen_decl (chain_p, 0, ansi),
+                                     NULL_PTR);
                  chain_p = TREE_CHAIN (chain_p);
-                 data_type = concat (data_type, "; ");
+                 data_type = concat (data_type, "; ", NULL_PTR);
                }
-             data_type = concat3 ("{ ", data_type, "}");
+             data_type = concat ("{ ", data_type, "}", NULL_PTR);
            }
-         data_type = concat ("union ", data_type);
+         data_type = concat ("union ", data_type, NULL_PTR);
          break;
 
         case ENUMERAL_TYPE:
@@ -461,14 +471,14 @@ gen_type (ret_val, t, style)
              while (chain_p)
                {
                  data_type = concat (data_type,
-                       IDENTIFIER_POINTER (TREE_PURPOSE (chain_p)));
+                       IDENTIFIER_POINTER (TREE_PURPOSE (chain_p)), NULL_PTR);
                  chain_p = TREE_CHAIN (chain_p);
                  if (chain_p)
-                   data_type = concat (data_type, ", ");
+                   data_type = concat (data_type, ", ", NULL_PTR);
                }
-             data_type = concat3 ("{ ", data_type, " }");
+             data_type = concat ("{ ", data_type, " }", NULL_PTR);
            }
-         data_type = concat ("enum ", data_type);
+         data_type = concat ("enum ", data_type, NULL_PTR);
          break;
 
         case TYPE_DECL:
@@ -480,7 +490,7 @@ gen_type (ret_val, t, style)
           /* Normally, `unsigned' is part of the deal.  Not so if it comes
             with a type qualifier.  */
           if (TREE_UNSIGNED (t) && TYPE_QUALS (t))
-           data_type = concat ("unsigned ", data_type);
+           data_type = concat ("unsigned ", data_type, NULL_PTR);
          break;
 
         case REAL_TYPE:
@@ -500,11 +510,11 @@ gen_type (ret_val, t, style)
         }
     }
   if (TYPE_READONLY (t))
-    ret_val = concat ("const ", ret_val);
+    ret_val = concat ("const ", ret_val, NULL_PTR);
   if (TYPE_VOLATILE (t))
-    ret_val = concat ("volatile ", ret_val);
+    ret_val = concat ("volatile ", ret_val, NULL_PTR);
   if (TYPE_RESTRICT (t))
-    ret_val = concat ("restrict ", ret_val);
+    ret_val = concat ("restrict ", ret_val, NULL_PTR);
   return ret_val;
 }
 
@@ -546,9 +556,9 @@ gen_decl (decl, is_func_definition, style)
      generate the qualifiers here.  */
 
   if (TREE_THIS_VOLATILE (decl))
-    ret_val = concat ("volatile ", ret_val);
+    ret_val = concat ("volatile ", ret_val, NULL_PTR);
   if (TREE_READONLY (decl))
-    ret_val = concat ("const ", ret_val);
+    ret_val = concat ("const ", ret_val, NULL_PTR);
 
   data_type = "";
 
@@ -566,7 +576,8 @@ gen_decl (decl, is_func_definition, style)
 
   if (TREE_CODE (decl) == FUNCTION_DECL && is_func_definition)
     {
-      ret_val = concat (ret_val, gen_formal_list_for_func_def (decl, ansi));
+      ret_val = concat (ret_val, gen_formal_list_for_func_def (decl, ansi),
+                       NULL_PTR);
 
       /* Since we have already added in the formals list stuff, here we don't
          add the whole "type" of the function we are considering (which
@@ -583,11 +594,11 @@ gen_decl (decl, is_func_definition, style)
   ret_val = affix_data_type (ret_val);
 
   if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
-    ret_val = concat ("register ", ret_val);
+    ret_val = concat ("register ", ret_val, NULL_PTR);
   if (TREE_PUBLIC (decl))
-    ret_val = concat ("extern ", ret_val);
+    ret_val = concat ("extern ", ret_val, NULL_PTR);
   if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl))
-    ret_val = concat ("static ", ret_val);
+    ret_val = concat ("static ", ret_val, NULL_PTR);
 
   return ret_val;
 }
index d6b2aa0b670f97dbd1343be17b377cee52828025..87868a0e8307560f2d345ed50631957d3413d954 100644 (file)
@@ -1035,9 +1035,6 @@ static void pfatal_with_name PROTO((char *)) __attribute__ ((noreturn));
 static void pipe_closed PROTO((int)) __attribute__ ((noreturn));
 
 static void memory_full PROTO((void)) __attribute__ ((noreturn));
-GENERIC_PTR xmalloc PROTO((size_t));
-static GENERIC_PTR xrealloc PROTO((GENERIC_PTR, size_t));
-static GENERIC_PTR xcalloc PROTO((size_t, size_t));
 static char *savestring PROTO((char *));
 static void print_help PROTO((void));
 \f
@@ -10678,34 +10675,33 @@ memory_full ()
   fatal ("Memory exhausted.");
 }
 
-
-GENERIC_PTR
+PTR
 xmalloc (size)
-     size_t size;
+  size_t size;
 {
-  register GENERIC_PTR ptr = (GENERIC_PTR) malloc (size);
+  register PTR ptr = (PTR) malloc (size);
   if (!ptr)
     memory_full ();
   return ptr;
 }
 
-static GENERIC_PTR
+PTR
 xrealloc (old, size)
-     GENERIC_PTR old;
-     size_t size;
+  PTR old;
+  size_t size;
 {
-  register GENERIC_PTR ptr = (GENERIC_PTR) realloc (old, size);
+  register PTR ptr = (PTR) realloc (old, size);
   if (!ptr)
     memory_full ();
   return ptr;
 }
 
-static GENERIC_PTR
+PTR
 xcalloc (number, size)
-     size_t number, size;
+  size_t number, size;
 {
   register size_t total = number * size;
-  register GENERIC_PTR ptr = (GENERIC_PTR) malloc (total);
+  register PTR ptr = (PTR) malloc (total);
   if (!ptr)
     memory_full ();
   bzero (ptr, total);
index d2d67f4c1cd127402be2e2e51054ea5829befa12..918f8284d76702092deececd582c04f91c6e93f0 100644 (file)
@@ -164,7 +164,6 @@ extern int c89;
 
 struct constant;
 
-GENERIC_PTR xmalloc PROTO((size_t));
 HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
 int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
 struct hashnode *lookup PROTO((U_CHAR *, int, int));
@@ -181,7 +180,7 @@ static void integer_overflow PROTO((void));
 #define SIGNED (~0)
 #define UNSIGNED 0
 
-#line 195 "cexp.y"
+#line 188 "cexp.y"
 typedef union {
   struct constant {HOST_WIDE_INT value; int signedp;} integer;
   struct name {U_CHAR *address; int length;} name;
@@ -262,10 +261,10 @@ static const short yyrhs[] = {    35,
 
 #if YYDEBUG != 0
 static const short yyrline[] = { 0,
-   225,   235,   236,   243,   248,   251,   253,   256,   260,   262,
-   267,   272,   285,   302,   315,   321,   327,   333,   339,   342,
-   345,   352,   359,   366,   373,   376,   379,   382,   385,   388,
-   391,   394,   396,   399,   402,   404,   406,   414,   416,   429
+   218,   228,   229,   236,   241,   244,   246,   249,   253,   255,
+   260,   265,   278,   295,   308,   314,   320,   326,   332,   335,
+   338,   345,   352,   359,   366,   369,   372,   375,   378,   381,
+   384,   387,   389,   392,   395,   397,   399,   407,   409,   422
 };
 #endif
 
@@ -869,7 +868,7 @@ yyreduce:
   switch (yyn) {
 
 case 1:
-#line 226 "cexp.y"
+#line 219 "cexp.y"
 {
                  expression_value = yyvsp[0].integer.value;
 #ifdef TEST_EXP_READER
@@ -878,55 +877,55 @@ case 1:
                ;
     break;}
 case 3:
-#line 237 "cexp.y"
+#line 230 "cexp.y"
 { if (pedantic)
                            pedwarn ("comma operator in operand of `#if'");
                          yyval.integer = yyvsp[0].integer; ;
     break;}
 case 4:
-#line 244 "cexp.y"
+#line 237 "cexp.y"
 { yyval.integer.value = - yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[0].integer.signedp;
                          if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0)
                            integer_overflow (); ;
     break;}
 case 5:
-#line 249 "cexp.y"
+#line 242 "cexp.y"
 { yyval.integer.value = ! yyvsp[0].integer.value;
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 6:
-#line 252 "cexp.y"
+#line 245 "cexp.y"
 { yyval.integer = yyvsp[0].integer; ;
     break;}
 case 7:
-#line 254 "cexp.y"
+#line 247 "cexp.y"
 { yyval.integer.value = ~ yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[0].integer.signedp; ;
     break;}
 case 8:
-#line 257 "cexp.y"
+#line 250 "cexp.y"
 { yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length,
                                                      0, NULL_PTR);
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 9:
-#line 261 "cexp.y"
+#line 254 "cexp.y"
 { keyword_parsing = 1; ;
     break;}
 case 10:
-#line 263 "cexp.y"
+#line 256 "cexp.y"
 { yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length,
                                                      1, yyvsp[-1].keywords);
                          keyword_parsing = 0;
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 11:
-#line 268 "cexp.y"
+#line 261 "cexp.y"
 { yyval.integer = yyvsp[-1].integer; ;
     break;}
 case 12:
-#line 273 "cexp.y"
+#line 266 "cexp.y"
 { yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
                          if (yyval.integer.signedp)
                            {
@@ -941,7 +940,7 @@ case 12:
                                        * yyvsp[0].integer.value); ;
     break;}
 case 13:
-#line 286 "cexp.y"
+#line 279 "cexp.y"
 { if (yyvsp[0].integer.value == 0)
                            {
                              if (!skip_evaluation)
@@ -960,7 +959,7 @@ case 13:
                                        / yyvsp[0].integer.value); ;
     break;}
 case 14:
-#line 303 "cexp.y"
+#line 296 "cexp.y"
 { if (yyvsp[0].integer.value == 0)
                            {
                              if (!skip_evaluation)
@@ -975,7 +974,7 @@ case 14:
                                        % yyvsp[0].integer.value); ;
     break;}
 case 15:
-#line 316 "cexp.y"
+#line 309 "cexp.y"
 { yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
                          if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value,
@@ -983,7 +982,7 @@ case 15:
                            integer_overflow (); ;
     break;}
 case 16:
-#line 322 "cexp.y"
+#line 315 "cexp.y"
 { yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp;
                          if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value,
@@ -991,7 +990,7 @@ case 16:
                            integer_overflow (); ;
     break;}
 case 17:
-#line 328 "cexp.y"
+#line 321 "cexp.y"
 { yyval.integer.signedp = yyvsp[-2].integer.signedp;
                          if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
                            yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -999,7 +998,7 @@ case 17:
                            yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
     break;}
 case 18:
-#line 334 "cexp.y"
+#line 327 "cexp.y"
 { yyval.integer.signedp = yyvsp[-2].integer.signedp;
                          if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0)
                            yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value);
@@ -1007,17 +1006,17 @@ case 18:
                            yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ;
     break;}
 case 19:
-#line 340 "cexp.y"
+#line 333 "cexp.y"
 { yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value);
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 20:
-#line 343 "cexp.y"
+#line 336 "cexp.y"
 { yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value);
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 21:
-#line 346 "cexp.y"
+#line 339 "cexp.y"
 { yyval.integer.signedp = SIGNED;
                          if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
                            yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value;
@@ -1026,7 +1025,7 @@ case 21:
                                        <= yyvsp[0].integer.value); ;
     break;}
 case 22:
-#line 353 "cexp.y"
+#line 346 "cexp.y"
 { yyval.integer.signedp = SIGNED;
                          if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
                            yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value;
@@ -1035,7 +1034,7 @@ case 22:
                                        >= yyvsp[0].integer.value); ;
     break;}
 case 23:
-#line 360 "cexp.y"
+#line 353 "cexp.y"
 { yyval.integer.signedp = SIGNED;
                          if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
                            yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value;
@@ -1044,7 +1043,7 @@ case 23:
                                        < yyvsp[0].integer.value); ;
     break;}
 case 24:
-#line 367 "cexp.y"
+#line 360 "cexp.y"
 { yyval.integer.signedp = SIGNED;
                          if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp)
                            yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value;
@@ -1053,64 +1052,64 @@ case 24:
                                        > yyvsp[0].integer.value); ;
     break;}
 case 25:
-#line 374 "cexp.y"
+#line 367 "cexp.y"
 { yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
     break;}
 case 26:
-#line 377 "cexp.y"
+#line 370 "cexp.y"
 { yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
     break;}
 case 27:
-#line 380 "cexp.y"
+#line 373 "cexp.y"
 { yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ;
     break;}
 case 28:
-#line 383 "cexp.y"
+#line 376 "cexp.y"
 { skip_evaluation += !yyvsp[-1].integer.value; ;
     break;}
 case 29:
-#line 385 "cexp.y"
+#line 378 "cexp.y"
 { skip_evaluation -= !yyvsp[-3].integer.value;
                          yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value);
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 30:
-#line 389 "cexp.y"
+#line 382 "cexp.y"
 { skip_evaluation += !!yyvsp[-1].integer.value; ;
     break;}
 case 31:
-#line 391 "cexp.y"
+#line 384 "cexp.y"
 { skip_evaluation -= !!yyvsp[-3].integer.value;
                          yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value);
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 32:
-#line 395 "cexp.y"
+#line 388 "cexp.y"
 { skip_evaluation += !yyvsp[-1].integer.value; ;
     break;}
 case 33:
-#line 397 "cexp.y"
+#line 390 "cexp.y"
 { skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ;
     break;}
 case 34:
-#line 399 "cexp.y"
+#line 392 "cexp.y"
 { skip_evaluation -= !!yyvsp[-6].integer.value;
                          yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value;
                          yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ;
     break;}
 case 35:
-#line 403 "cexp.y"
+#line 396 "cexp.y"
 { yyval.integer = yylval.integer; ;
     break;}
 case 36:
-#line 405 "cexp.y"
+#line 398 "cexp.y"
 { yyval.integer = yylval.integer; ;
     break;}
 case 37:
-#line 407 "cexp.y"
+#line 400 "cexp.y"
 { if (warn_undef && !skip_evaluation)
                            warning ("`%.*s' is not defined",
                                     yyvsp[0].name.length, yyvsp[0].name.address);
@@ -1118,11 +1117,11 @@ case 37:
                          yyval.integer.signedp = SIGNED; ;
     break;}
 case 38:
-#line 415 "cexp.y"
+#line 408 "cexp.y"
 { yyval.keywords = 0; ;
     break;}
 case 39:
-#line 417 "cexp.y"
+#line 410 "cexp.y"
 { struct arglist *temp;
                          yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
                          yyval.keywords->next = yyvsp[-2].keywords;
@@ -1137,7 +1136,7 @@ case 39:
                          temp->next->length = 1; ;
     break;}
 case 40:
-#line 430 "cexp.y"
+#line 423 "cexp.y"
 { yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist));
                          yyval.keywords->name = yyvsp[-1].name.address;
                          yyval.keywords->length = yyvsp[-1].name.length;
@@ -1341,7 +1340,7 @@ yyerrhandle:
   yystate = yyn;
   goto yynewstate;
 }
-#line 435 "cexp.y"
+#line 428 "cexp.y"
 
 \f
 /* During parsing of a C expression, the pointer to the next character
@@ -2156,10 +2155,10 @@ lookup (name, len, hash)
   return (DEFAULT_SIGNED_CHAR) ? 0 : ((struct hashnode *) -1);
 }
 
-GENERIC_PTR
+PTR
 xmalloc (size)
-     size_t size;
+  size_t size;
 {
-  return (GENERIC_PTR) malloc (size);
+  return (PTR) malloc (size);
 }
 #endif
index b3b5e9d99a33acb6a23b95b9f437020396ff36f2..d63c4d1114362ec9703eb2b716e0652115af43f4 100644 (file)
@@ -168,7 +168,6 @@ extern int c89;
 
 struct constant;
 
-GENERIC_PTR xmalloc PROTO((size_t));
 HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
 int check_assertion PROTO((U_CHAR *, int, int, struct arglist *));
 struct hashnode *lookup PROTO((U_CHAR *, int, int));
@@ -1240,10 +1239,10 @@ lookup (name, len, hash)
   return (DEFAULT_SIGNED_CHAR) ? 0 : ((struct hashnode *) -1);
 }
 
-GENERIC_PTR
+PTR
 xmalloc (size)
-     size_t size;
+  size_t size;
 {
-  return (GENERIC_PTR) malloc (size);
+  return (PTR) malloc (size);
 }
 #endif
index 3a41f1284939110f38361651ee39fac9007d5438..7638e4d84620ba0e536139de604dbb37bbd5a071 100644 (file)
@@ -302,10 +302,6 @@ static char *resolve_lib_name      PROTO((char *));
 static int use_import_list     PROTO((char *));
 static int ignore_library      PROTO((char *));
 #endif
-
-char *xcalloc ();
-char *xmalloc ();
-
 \f
 #ifdef NO_DUP2
 int
@@ -514,36 +510,32 @@ handler (signo)
 }
 
 \f
-char *
+PTR
 xcalloc (size1, size2)
-     int size1, size2;
+  size_t size1, size2;
 {
-  char *ptr = (char *) calloc (size1, size2);
-  if (ptr)
-    return ptr;
-
-  fatal ("out of memory");
-  return (char *) 0;
+  PTR ptr = (PTR) calloc (size1, size2);
+  if (!ptr)
+    fatal ("out of memory");
+  return ptr;
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  char *ptr = (char *) malloc (size);
-  if (ptr)
-    return ptr;
-
-  fatal ("out of memory");
-  return (char *) 0;
+  PTR ptr = (PTR) malloc (size);
+  if (!ptr)
+    fatal ("out of memory");
+  return ptr;
 }
 
-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;
index 8c5607af47141b171cc90b90a055e4c6209583da..5d3b2a0247e741782c80570f8a120cb643a6d26a 100644 (file)
@@ -66,7 +66,7 @@ extern struct jumplabel_array jmplbl[];
 extern int datalbl_ndx, jmplbl_ndx, label_pending, program_counter;
 extern enum section current_section;
 extern char *sectname[4];
-extern char *xstrdup(), *float_label();
+extern char *float_label();
 extern struct rtx_def *function_arg ();
 extern char *movcnt_regno_adjust ();
 extern char *mod_regno_adjust ();
index 46581c781a1f171808d60f59d4ddf7fc341527e0..3cd72ee1fa2ef676d160410df7f9846228a57f86 100644 (file)
@@ -35,22 +35,22 @@ memory_full ()
   exit (FATAL_EXIT_CODE);
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *ptr = (char *) malloc (size);
+  register PTR ptr = (PTR) malloc (size);
   if (ptr == 0)
     memory_full ();
   return ptr;
 }
 
-char *
+PTR
 xrealloc (old, size)
-     char *old;
-     unsigned size;
+  PTR old;
+  size_t size;
 {
-  register char *ptr = (char *) realloc (old, size);
+  register PTR ptr = (PTR) realloc (old, size);
   if (ptr == 0)
     memory_full ();
   return ptr;
index b77c3d7559d24e570842e062e1368b1a93eb7293..419e5bd79dce18a69f496ff24886bbf066bc33a5 100644 (file)
@@ -28,9 +28,6 @@ Written by Per Bothner 1994.  */
 #include "system.h"
 #include "cpplib.h"
 
-extern char *xmalloc PARAMS ((unsigned));
-extern char *xrealloc PARAMS ((void *, unsigned));
-
 #ifdef MULTIBYTE_CHARS
 #include <locale.h>
 #endif
index 0703250720b7ed6a2bc35693b5609a89c356835d..8a4a0efb41cf44987bb8fc5a38c232cb53fd07a0 100644 (file)
@@ -47,10 +47,6 @@ static void simplify_pathname                PROTO ((char *));
 static void hack_vms_include_specification PROTO ((char *));
 #endif
 
-/* Not safe to prototype these. */
-extern char *xmalloc();
-extern char *xrealloc();
-
 /* Windows does not natively support inodes, and neither does MSDOS.
    VMS has non-numeric inodes. */
 #ifdef VMS
index 85883e351370881b0c204a07915575a37d9c0795..1fcabaf0c86cc865c2efe5fa20568b1f2fb1c29d 100644 (file)
@@ -27,8 +27,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #include "cpplib.h"
 #include "cpphash.h"
 
-extern char *xmalloc PARAMS ((unsigned));
-
 static HASHNODE *hashtab[HASHSIZE];
 
 /* Return hash function on name.  must be compatible with the one
index 227441353a11e3e1d5332646978ce1500e69dbb3..828bcf9a0a71ee8a3f83ba4da414ba6c5b4a941f 100644 (file)
@@ -184,7 +184,6 @@ struct cpp_pending {
 
 /* Forward declarations.  */
 
-char *xmalloc ();
 extern void cpp_hash_cleanup PARAMS ((cpp_reader *));
 
 static char *my_strerror               PROTO ((int));
@@ -213,8 +212,6 @@ static void free_token_list         PROTO ((struct arglist *));
 static void push_macro_expansion PARAMS ((cpp_reader *,
                                          U_CHAR *, int, HASHNODE *));
 static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending *));
-extern char *xrealloc ();
-static char *xcalloc                   PROTO ((unsigned, unsigned));
 
 static void conditional_skip           PROTO ((cpp_reader *, int,
                                               enum node_type, U_CHAR *));
@@ -6436,12 +6433,12 @@ free_token_list (tokens)
    be moved into cppalloc.c.  We can't do that right now because
    then we'd get multiple-symbol clashes with toplev.c and several
    other people. */
-static char *
+PTR
 xcalloc (number, size)
-     unsigned number, size;
+  size_t number, size;
 {
   register unsigned total = number * size;
-  register char *ptr = (char *) xmalloc (total);
+  register PTR ptr = (PTR) xmalloc (total);
   bzero (ptr, total);
   return ptr;
 }
index a5f40cc0ec1c56dd1c2f4f742a5b271aceeb8200..4f8eb160765cb55a4ea2182f1d5cc4e15ac94b2e 100644 (file)
@@ -22,9 +22,6 @@
 #include "system.h"
 #include "dyn-string.h"
 
-extern char *xmalloc ();
-extern char *xrealloc ();
-
 /* Create a new dynamic string capable of holding at least SPACE
    characters, including the terminating NUL.  If SPACE is 0, it
    will be silently increased to 1.  */
index 08f5be427c2231517bfc495a9a495eaca4e963f8..76ae479e0ae67a6c08086990ae1abf8bcfd564e1 100644 (file)
@@ -873,7 +873,7 @@ write_rbrac ()
 
 char *
 xstrdup (str)
-     char *str;
+  const char *str;
 {
   char *copy = (char *) xmalloc (strlen (str) + 1);
   strcpy (copy, str);
index 6f3ed848595a85972fef074cc228f854758d6698..8521665768c4d97066200861a38a47a92b54262c 100644 (file)
--- 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;
 }
 \f
-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;
index 2a093c621fb4f7f57bcd042509bcd5e5023c7dc1..102b14d7951ff93368b18cc36568f2ec5f7cae2e 100644 (file)
@@ -218,7 +218,6 @@ static void read_files PROTO ((void));
 static void scan_for_source_files PROTO ((void));
 static void output_data PROTO ((void));
 static void print_usage PROTO ((void)) ATTRIBUTE_NORETURN;
-char * xmalloc ();
 
 int
 main (argc, argv)
@@ -238,11 +237,11 @@ main (argc, argv)
   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)
     {
       fprintf (stderr, "error: virtual memory exhausted");
index dd44fde6ba8385cf7cbfe0bc3734ef244656f560..4064ef012fdbf1a0b4d1e30855fdf658f962877a 100644 (file)
@@ -31,7 +31,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -199,23 +198,23 @@ write_units (num_units, multiplicity, simultaneity,
   printf ("#define INSN_QUEUE_SIZE %d\n", q_size);
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char * result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index 8bb3dc6994817da4194a91c6c6e7688ba94e7b3e..00b48963f5647632a3c78285088a37164ec75b14 100644 (file)
@@ -453,8 +453,6 @@ static struct attr_value *find_most_used  PROTO((struct attr_desc *));
 static rtx find_single_value   PROTO((struct attr_desc *));
 static rtx make_numeric_value  PROTO((int));
 static void extend_range       PROTO((struct range *, int, int));
-char *xrealloc                 PROTO((char *, unsigned));
-char *xmalloc                  PROTO((unsigned));
 
 #define oballoc(size) obstack_alloc (hash_obstack, size)
 
@@ -5752,22 +5750,22 @@ extend_range (range, min, max)
   if (range->max < max) range->max = max;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
index 915f30802924d7a2bca1355fa48fb25ad5e4ca92..a10c40b6b3bf8ffa344f90cc1f84dad4edb3ca5d 100644 (file)
@@ -66,11 +66,11 @@ int main (argc, argv)
 /* FIXME: We only need an xmalloc definition because we are forced to
    link with alloca.o on some platforms.  This should go away if/when
    we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
-char *
+PTR
 xmalloc (nbytes)
-     int nbytes;
+  size_t nbytes;
 {
-  char *tmp = (char *) malloc (nbytes);
+  register PTR tmp = (PTR) malloc (nbytes);
 
   if (!tmp)
     {
index 696dbfb28024b4c78e79eb61c571b764fd5547b3..3aa7d30ed726a99db94b1856eab9b22e5bc83f8e 100644 (file)
@@ -33,7 +33,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -57,23 +56,23 @@ gen_insn (insn)
            insn_code_number);
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index e61e1a24ba9170f1599e86882405c7098f21738c..086462fd31fbf78e1dd7d9d90e0613fe6fe530e8 100644 (file)
@@ -49,7 +49,6 @@ static int max_insns_per_split = 1;
 static int clobbers_seen_this_insn;
 static int dup_operands_seen_this_insn;
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -245,11 +244,11 @@ gen_peephole (peep)
     walk_insn_part (XVECEXP (peep, 0, i), 1, 0);
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
@@ -257,12 +256,12 @@ xmalloc (size)
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index f67dacbb68318c8720c1713c888d6752e03f605f..7e556235c1a5c6e8f1e274f23b3e988d48ec4797 100644 (file)
@@ -30,7 +30,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -679,11 +678,11 @@ output_init_mov_optab ()
 #endif
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
@@ -691,12 +690,12 @@ xmalloc (size)
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index 00bc571c99133ee7a8f700641c1517b408fcecac..f17ab671fc3d4848c08ae1b451f91289f15e930a 100644 (file)
@@ -98,8 +98,6 @@ static struct code_ptr *peepholes;
 static void gen_insn PROTO ((rtx));
 static void walk_rtx PROTO ((rtx, char *));
 static void print_path PROTO ((char *));
-char *xmalloc PROTO ((unsigned));
-char *xrealloc PROTO ((char *, unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 static char *copystr PROTO ((char *));
@@ -348,23 +346,23 @@ print_path (path)
     }
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index b56175f86a3d76866099aa8e6c2f8f009f2cb5f3..5d21082ed8799008352cef68af16338d69c18966 100644 (file)
@@ -33,7 +33,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -176,11 +175,11 @@ gen_insn (insn)
   obstack_grow (obstack_ptr, &insn, sizeof (rtx));
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
@@ -188,12 +187,12 @@ xmalloc (size)
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index 73eb39d79635335b683d94650b4d6b4d7e82a530..e99cb723e843b618d6e245ea1bd45f6f35acf752 100644 (file)
@@ -281,11 +281,11 @@ gencode (f)
 }
 
 #if defined(USE_C_ALLOCA)
-char *
+PTR
 xmalloc (nbytes)
-     int nbytes;
+  size_t nbytes;
 {
-  char *tmp = (char *) malloc (nbytes);
+  register PTR tmp = (PTR) malloc (nbytes);
 
   if (!tmp)
     {
index 985be8fdb0bbf68e1fc91fcfc5cab7d8da34ef75..882240107cdcf82314d010bee0abd491500be25f 100644 (file)
@@ -30,7 +30,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -281,11 +280,11 @@ gen_insn (insn)
   printf (";\n");
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
@@ -293,12 +292,12 @@ xmalloc (size)
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index 1651070c96d0a17a6425dbbdeff4c58c8a8e91b6..af68b613690236747bb68c9a56830b20f656449d 100644 (file)
@@ -107,7 +107,6 @@ struct obstack *rtl_obstack = &obstack;
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -881,23 +880,23 @@ gen_split (split)
   d->outfun = 0;
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index ad9efabad4d9383c7a0568b8c6941618808faca5..25179bb86758f66b7a73fdbf313100bef3399b26 100644 (file)
@@ -46,7 +46,6 @@ struct link
   int vecelt;
 };
 
-char *xmalloc PROTO((unsigned));
 static void fatal PVPROTO ((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
 void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
@@ -385,23 +384,23 @@ print_code (code)
     }
 }
 \f
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
   return val;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
index db4566ad615b24d7d42223f93873868bd98ddf53..0e1245cde449ec8e11da5705601b226adfd93c91 100644 (file)
@@ -193,8 +193,6 @@ static void mybzero         PROTO((char *, unsigned));
 static void mybcopy            PROTO((char *, char *, unsigned));
 static void fatal              PVPROTO((char *, ...))
   ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-char *xrealloc                 PROTO((char *, unsigned));
-char *xmalloc                  PROTO((unsigned));
 void fancy_abort               PROTO((void)) ATTRIBUTE_NORETURN;
 \f
 /* Construct and return a sequence of decisions
@@ -1660,22 +1658,22 @@ mybcopy (in, out, length)
     *out++ = *in++;
 }
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     unsigned size;
+  PTR ptr;
+  size_t size;
 {
-  char *result = (char *) realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted");
   return result;
 }
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *val = (char *) malloc (size);
+  register PTR val = (PTR) malloc (size);
 
   if (val == 0)
     fatal ("virtual memory exhausted");
index 69f8c8243b58b8049cf136ecb33d5ecb289263ab..3d5f43f7408ba88a7477876948dc17ec84b3ec26 100644 (file)
@@ -20,8 +20,6 @@
 #define GUESSPATHLEN 100
 #endif /* (defined (USG) || defined (VMS)) */
 
-char *xmalloc ();
-
 #if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
 
 /* Get the working directory.  Use the PWD environment variable if it's
index 2c19c554f6366f3e9b05d1360ad3b3cf79484a75..8505a5844ea5286f3792a3f7411244808880a2cc 100644 (file)
@@ -40,7 +40,6 @@ Boston, MA 02111-1307, USA.  */
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-extern char *xmalloc ();
 extern rtx eliminate_constant_term ();
 extern void assemble_name ();
 extern void output_addr_const ();
index 34b6a64abfa7e09df537c793a93b8fc2bf7ea063..707fdb53fd3128084f8021e66dc60b9cf9959b09 100644 (file)
@@ -28,8 +28,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-extern char * xmalloc ();
-
 /* The default number of entries to use when creating a hash table.  */
 #define DEFAULT_SIZE (1009)
 
index 558e090a64d27c8937473cf7e72e90399ac7217b..fdf018ec5faf14ab174392887bf0f6425b3875f8 100644 (file)
@@ -47,24 +47,9 @@ Boston, MA 02111-1307, USA.  */
 #define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
 #endif
 
-#ifdef __STDC__
-typedef void *PTR_T;
-typedef const void *CPTR_T;
-#define __proto(x) x
-#else
-
-#if defined(_STDIO_H_) || defined(__STDIO_H__)         /* Ultrix 4.0, SGI */
-typedef void *PTR_T;
-typedef void *CPTR_T;
-
-#else
-typedef char *PTR_T;                                   /* Ultrix 3.1 */
-typedef char *CPTR_T;
-#endif
-
-#define __proto(x) ()
-#define const
-#endif
+#define __proto(x) PARAMS(x)
+typedef PTR PTR_T;
+typedef const PTR_T CPTR_T;
 
 #define uchar  unsigned char
 #define ushort unsigned short
@@ -72,6 +57,27 @@ typedef char *CPTR_T;
 #define ulong  unsigned long
 
 
+static void
+fatal(s)
+  const char *s;
+{
+  fprintf(stderr, "%s\n", s);
+  exit(FATAL_EXIT_CODE);
+}
+
+/* Same as `malloc' but report error if no memory available.  */
+/* Do this before size_t is fiddled with so it matches the prototype
+   in libiberty.h . */
+PTR
+xmalloc (size)
+  size_t size;
+{
+  register PTR value = (PTR) malloc (size);
+  if (value == 0)
+    fatal ("Virtual memory exhausted.");
+  return value;
+}
+
 /* Do to size_t being defined in sys/types.h and different
    in stddef.h, we have to do this by hand.....  Note, these
    types are correct for MIPS based systems, and may not be
@@ -270,10 +276,15 @@ char *lang_to_string      __proto((lang_t));
 char *type_to_string   __proto((AUXU *, int, FDR *));
 
 #ifndef __alpha
+# ifdef NEED_DECLARATION_MALLOC
 extern PTR_T   malloc  __proto((size_t));
+# endif
+# ifdef NEED_DECLARATION_CALLOC
 extern PTR_T   calloc  __proto((size_t, size_t));
+# endif
+# ifdef NEED_DECLARATION_REALLOC
 extern PTR_T   realloc __proto((PTR_T, size_t));
-extern void    free    __proto((PTR_T));
+# endif
 #endif
 
 extern char *optarg;
@@ -1590,23 +1601,3 @@ fancy_abort ()
   fprintf (stderr, "mips-tdump internal error");
   exit (1);
 }
-
-void
-fatal(s)
-char *s;
-{
-  fprintf(stderr, "%s\n", s);
-  exit(1);
-}
-
-/* Same as `malloc' but report error if no memory available.  */
-
-PTR_T
-xmalloc (size)
-     unsigned size;
-{
-  register PTR_T value = malloc (size);
-  if (value == 0)
-    fatal ("Virtual memory exhausted.");
-  return value;
-}
index ad112fccbcbfff063d60fe4b519f40f26dff13e4..06b9b5012afc3015fd387c42217749b24579de09 100644 (file)
@@ -611,24 +611,10 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #define __proto(x) PARAMS(x)
-/* Should PTR_T and CPTR_T be typedef'ed in terms of PTR ??? */
-#ifdef __STDC__
-typedef void *PTR_T;
-typedef const void *CPTR_T;
-#else
-
-#if defined(_STDIO_H_) || defined(__STDIO_H__)         /* Ultrix 4.0, SGI */
-typedef void *PTR_T;
-typedef void *CPTR_T;
-
-#else
-typedef char *PTR_T;                                   /* Ultrix 3.1 */
-typedef char *CPTR_T;
-#endif
+typedef PTR PTR_T;
+typedef const PTR_T CPTR_T;
 
-#endif
-
-/* Do to size_t being defined in sys/types.h and different
+/* Due to size_t being defined in sys/types.h and different
    in stddef.h, we have to do this by hand.....  Note, these
    types are correct for MIPS based systems, and may not be
    correct for other systems.  Ultrix 4.0 and Silicon Graphics
@@ -650,10 +636,7 @@ extern void        pfatal_with_name
                                __proto((char *));
 extern void    fancy_abort     __proto((void));
        void    botch           __proto((const char *));
-extern PTR_T   xmalloc         __proto((Size_t));
-extern PTR_T   xcalloc         __proto((Size_t, Size_t));
-extern PTR_T   xrealloc        __proto((PTR_T, Size_t));
-extern void    xfree           __proto((PTR_T));
+extern void    xfree           __proto((PTR));
 
 extern void    fatal           PVPROTO((const char *format, ...));
 extern void    error           PVPROTO((const char *format, ...));
@@ -5597,14 +5580,14 @@ void
 fatal VPROTO((const char *format, ...))
 {
 #ifndef ANSI_PROTOTYPES
-  char *format;
+  const char *format;
 #endif
   va_list ap;
 
   VA_START (ap, format);
 
 #ifndef ANSI_PROTOTYPES
-  format = va_arg (ap, char *);
+  format = va_arg (ap, const char *);
 #endif
 
   if (line_number > 0)
@@ -5675,11 +5658,11 @@ botch (s)
 
 /* Same as `malloc' but report error if no memory available.  */
 
-PTR_T
+PTR
 xmalloc (size)
-     Size_t size;
+  size_t size;
 {
-  register PTR_T value = malloc (size);
+  register PTR value = (PTR) malloc (size);
   if (value == 0)
     fatal ("Virtual memory exhausted.");
 
@@ -5695,11 +5678,11 @@ xmalloc (size)
 
 /* Same as `calloc' but report error if no memory available.  */
 
-PTR_T
+PTR
 xcalloc (size1, size2)
-     Size_t size1, size2;
+  size_t size1, size2;
 {
-  register PTR_T value = calloc (size1, size2);
+  register PTR value = (PTR) calloc (size1, size2);
   if (value == 0)
     fatal ("Virtual memory exhausted.");
 
@@ -5717,12 +5700,12 @@ xcalloc (size1, size2)
 
 /* Same as `realloc' but report error if no memory available.  */
 
-PTR_T
+PTR
 xrealloc (ptr, size)
-     PTR_T ptr;
-     Size_t size;
+  PTR ptr;
+  size_t size;
 {
-  register PTR_T result = realloc (ptr, size);
+  register PTR result = (PTR) realloc (ptr, size);
   if (!result)
     fatal ("Virtual memory exhausted.");
 
@@ -5740,7 +5723,7 @@ xrealloc (ptr, size)
 
 void
 xfree (ptr)
-     PTR_T ptr;
+     PTR ptr;
 {
   if (debug > 3)
     {
index 387ff462dd4f8f0f4c1737fa02d116fc3465ff1b..3e98ded4d73796b01d0f643201e1eea034675ded 100644 (file)
@@ -73,7 +73,6 @@ static char *std_prefix = PREFIX;
 
 static char *get_key_value     PROTO((char *));
 static char *translate_name    PROTO((char *));
-static char *concat            PVPROTO((char *, ...));
 static char *save_string       PROTO((char *, int));
 
 #ifdef _WIN32
@@ -110,23 +109,23 @@ get_key_value (key)
 
    This function is based on the one in libiberty.  */
 
-static char *
-concat VPROTO((char *first, ...))
+char *
+concat VPROTO((const char *first, ...))
 {
   register int length;
   register char *newstr;
   register char *end;
-  register char *arg;
+  register const char *arg;
   va_list args;
 #ifndef ANSI_PROTOTYPES
-  char *first;
+  const 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 *);
+  first = va_arg (args, const char *);
 #endif
 
   arg = first;
@@ -135,7 +134,7 @@ concat VPROTO((char *first, ...))
   while (arg != 0)
     {
       length += strlen (arg);
-      arg = va_arg (args, char *);
+      arg = va_arg (args, const char *);
     }
 
   newstr = (char *) malloc (length + 1);
@@ -154,7 +153,7 @@ concat VPROTO((char *first, ...))
     {
       while (*arg)
        *end++ = *arg++;
-      arg = va_arg (args, char *);
+      arg = va_arg (args, const char *);
     }
   *end = '\000';
   va_end (args);
index 234b6e45bf418efe307a9c2f750b6e31ee46c4af..65242976034e6babb84228aa0d9701d3c936e873 100644 (file)
@@ -45,7 +45,7 @@ static char *reg_names[] = REGISTER_NAMES;
 
 static FILE *outfile;
 
-static char spaces[] = "                                                                                                                                                                ";
+static const char xspaces[] = "                                                                                                                                                                ";
 
 static int sawclose = 0;
 
@@ -77,7 +77,7 @@ print_rtx (in_rtx)
   if (sawclose)
     {
       fprintf (outfile, "\n%s",
-              (spaces + (sizeof spaces - 1 - indent * 2)));
+              (xspaces + (sizeof xspaces - 1 - indent * 2)));
       sawclose = 0;
     }
 
@@ -185,7 +185,7 @@ print_rtx (in_rtx)
        if (sawclose)
          {
            fprintf (outfile, "\n%s",
-                    (spaces + (sizeof spaces - 1 - indent * 2)));
+                    (xspaces + (sizeof xspaces - 1 - indent * 2)));
            sawclose = 0;
          }
        fputs ("[ ", outfile);
@@ -202,7 +202,7 @@ print_rtx (in_rtx)
          }
        if (sawclose)
          fprintf (outfile, "\n%s",
-                  (spaces + (sizeof spaces - 1 - indent * 2)));
+                  (xspaces + (sizeof xspaces - 1 - indent * 2)));
 
        fputs ("] ", outfile);
        sawclose = 1;
index b06f91bb4fccf81aae82cd3a0e959fbf8205a290..578247600bcf62379cdcd8d9f9d46fbda6facdc4 100644 (file)
@@ -53,8 +53,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "gcov-io.h"
 #include "toplev.h"
 
-extern char * xmalloc ();
-
 /* One of these is dynamically created whenever we identify an arc in the
    function.  */
 
index 659dab7a6d81b2ef570a344c162c63a4125998b5..77b1a11218ee3fe7698b586705227114e819ca9d 100644 (file)
@@ -109,17 +109,8 @@ extern char *version_string;
 
 extern char *getpwd ();
 
-extern char *choose_temp_base PROTO ((void));
 extern char * my_strerror PROTO ((int));
 
-extern int pexecute PROTO ((const char *, char * const *, const char *,
-                           const char *, char **, char **, int));
-extern int pwait PROTO ((int, int *, int));
-/* Flag arguments to pexecute.  */
-#define PEXECUTE_FIRST  1
-#define PEXECUTE_LAST   2
-#define PEXECUTE_SEARCH 4
-
 static void usage PROTO ((void)) ATTRIBUTE_NORETURN;
 static void aux_info_corrupted PROTO ((void)) ATTRIBUTE_NORETURN;
 static void declare_source_confusing PROTO ((const char *)) ATTRIBUTE_NORETURN;
@@ -128,13 +119,8 @@ static void declare_source_confusing PROTO ((const char *)) ATTRIBUTE_NORETURN;
    These were made to facilitate compilation with old brain-dead DEC C
    compilers which didn't properly grok `void*' types.  */
 
-#ifdef __STDC__
-typedef void * pointer_type;
-typedef const void * const_pointer_type;
-#else
-typedef char * pointer_type;
-typedef char * const_pointer_type;
-#endif
+typedef PTR pointer_type;
+typedef const PTR const_pointer_type;
 
 #if defined(POSIX)
 
@@ -605,19 +591,15 @@ my_strerror(e)
 
 pointer_type
 xmalloc (byte_count)
-     size_t byte_count;
+  size_t byte_count;
 {
-  pointer_type rv;
-
-  rv = (pointer_type) malloc (byte_count);
+  register pointer_type rv = (pointer_type) malloc (byte_count);
   if (rv == NULL)
     {
       fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
       exit (FATAL_EXIT_CODE);
-      return 0;                /* avoid warnings */
     }
-  else
-    return rv;
+  return rv;
 }
 
 /* Reallocate some space, but check that the reallocation was successful.  */
@@ -627,17 +609,13 @@ xrealloc (old_space, byte_count)
      pointer_type old_space;
      size_t byte_count;
 {
-  pointer_type rv;
-
-  rv = (pointer_type) realloc (old_space, byte_count);
+  register pointer_type rv = (pointer_type) realloc (old_space, byte_count);
   if (rv == NULL)
     {
       fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
       exit (FATAL_EXIT_CODE);
-      return 0;                /* avoid warnings */
     }
-  else
-    return rv;
+  return rv;
 }
 
 /* Deallocate the area pointed to by an arbitrary pointer, but first, strip
index 1bff7d3d916c2934827f050bc17c6c24c24faba4..bf9a603412d7524015a4482c9e3f66f7d121dab6 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -842,19 +842,6 @@ extern rtvec gen_rtvec                     PVPROTO((int, ...));
 extern rtx read_rtx                    PROTO((FILE *));
 #endif
 
-#if 0
-/* At present, don't prototype xrealloc, since all of the callers don't
-   cast their pointers to char *, and all of the xrealloc's don't use
-   void * yet.  */
-extern char *xmalloc                   PROTO((size_t));
-extern char *xcalloc                   PROTO((size_t, size_t));
-extern char *xrealloc                  PROTO((void *, size_t));
-#else
-extern char *xmalloc ();
-extern char *xcalloc ();
-extern char *xrealloc ();
-#endif
-
 extern char *oballoc                   PROTO((int));
 extern char *permalloc                 PROTO((int));
 extern rtx rtx_alloc                   PROTO((RTX_CODE));
index f27c9a3ceb4a3aee5445890a64e292fd65879918..9fcf8b86fd604002a543f0ab43f7cdae7000b7b8 100644 (file)
@@ -57,8 +57,6 @@ extern int skip_spaces _PARAMS((FILE *, int));
 extern int scan_ident _PARAMS((FILE *, sstring *, int));
 extern int scan_string _PARAMS((FILE *, sstring *, int));
 extern int read_upto _PARAMS((FILE *, sstring *, int));
-extern char *xmalloc _PARAMS((unsigned));
-extern char *xrealloc _PARAMS((char *, unsigned));
 extern unsigned long hash _PARAMS((const char *));
 extern void recognized_function _PARAMS((char *, int, int, char *, int, int, char *, int));
 extern void recognized_extern _PARAMS((char *, int, char *, int));
index ead550d45d584c3ff39e84d333df34f903a841c1..47a3b407d7b18868d81a4d58ec3f469ac476938d 100644 (file)
@@ -370,4 +370,7 @@ extern void abort ();
 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 #endif
 
+/* Get libiberty declarations. */
+#include "libiberty.h"
+
 #endif /* __GCC_SYSTEM_H__ */
index ec308c045f270f1e9a5fec723138b22dae69af47..9e7403a7c0ecc75ec46b91ebd0cfcf768ecf5138 100644 (file)
@@ -32,8 +32,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define obstack_chunk_alloc xmalloc
 #define obstack_chunk_free free
 
-extern char * xmalloc PARAMS((unsigned));
-
 /* Defined in collect2.c.  */
 extern int vflag, debug;
 extern char *ldout;
index 5fa7f22df6eec61561caeb052976e047d85d095a..e5c9319f29cda9e10a1fb7f3d1d76ffd24d01281 100644 (file)
@@ -1251,7 +1251,7 @@ int dump_time;
 \f
 /* Return time used so far, in microseconds.  */
 
-int
+long
 get_run_time ()
 {
   if (quiet_flag)
@@ -2173,16 +2173,16 @@ botch (s)
 
 /* Same as `malloc' but report error if no memory available.  */
 
-char *
+PTR
 xmalloc (size)
-     unsigned size;
+  size_t size;
 {
-  register char *value;
+  register PTR value;
 
   if (size == 0)
     size = 1;
 
-  value = (char *) malloc (size);
+  value = (PTR) malloc (size);
   if (value == 0)
     fatal ("virtual memory exhausted");
   return value;
@@ -2190,16 +2190,16 @@ xmalloc (size)
 
 /* Same as `calloc' but report error if no memory available.  */
 
-char *
+PTR
 xcalloc (size1, size2)
-     unsigned size1, size2;
+  size_t size1, size2;
 {
-  register char *value;
+  register PTR value;
 
   if (size1 == 0 || size2 == 0)
     size1 = size2 = 1;
 
-  value = (char *) calloc (size1, size2);
+  value = (PTR) calloc (size1, size2);
   if (value == 0)
     fatal ("virtual memory exhausted");
   return value;
@@ -2209,19 +2209,17 @@ xcalloc (size1, size2)
 /* Same as `realloc' but report error if no memory available.  
    Also handle null PTR even if the vendor realloc gets it wrong.  */
 
-char *
+PTR
 xrealloc (ptr, size)
-     char *ptr;
-     int size;
+  PTR ptr;
+  size_t size;
 {
-  char *result;
+  register PTR result;
 
   if (size == 0)
     size = 1;
 
-  result = (ptr
-           ? (char *) realloc (ptr, size)
-           : (char *) malloc (size));
+  result = (ptr ? (PTR) realloc (ptr, size) : (PTR) malloc (size));
 
   if (!result)
     fatal ("virtual memory exhausted");
@@ -2233,7 +2231,7 @@ xrealloc (ptr, size)
 
 char *
 xstrdup (s)
-     register char *s;
+  register const char *s;
 {
   register char *result = (char *) malloc (strlen (s) + 1);
 
index 38d0fca21fb616f1a147a3653dbe59274f1744e0..c309399a8645706a4c6dc82a437ac72ac97f7923 100644 (file)
@@ -13,7 +13,6 @@ struct rtx_def;
 extern int count_error                 PROTO ((int));
 extern void strip_off_ending           PROTO ((char *, int));
 extern void print_time                 PROTO ((char *, int));
-extern int get_run_time                        PROTO ((void));
 extern void debug_start_source_file    PROTO ((char *));
 extern void debug_end_source_file      PROTO ((unsigned));
 extern void debug_define               PROTO ((unsigned, char *));
index 513c3825ab08123f639b8dc11bb996b52c022cf8..895cf2a1b4a4ecfa7d1697bf186e7125f9ab9392 100644 (file)
@@ -1385,21 +1385,6 @@ union tree_node
 extern int exact_log2_wide             PROTO((unsigned HOST_WIDE_INT));
 extern int floor_log2_wide             PROTO((unsigned HOST_WIDE_INT));
 
-#if 0
-/* At present, don't prototype xrealloc, since all of the callers don't
-   cast their pointers to char *, and all of the xrealloc's don't use
-   void * yet.  */
-extern char *xmalloc                   PROTO((size_t));
-extern char *xcalloc                   PROTO((size_t, size_t));
-extern char *xrealloc                  PROTO((void *, size_t));
-#else
-extern char *xmalloc ();
-extern char *xcalloc ();
-extern char *xrealloc ();
-#endif
-
-extern char *xstrdup                   PROTO((char *));
-
 extern char *oballoc                   PROTO((int));
 extern char *permalloc                 PROTO((int));
 extern char *savealloc                 PROTO((int));