OSDN Git Service

* cppfiles.c (search_from): Special case the empty string.
[pf3gnuchains/gcc-fork.git] / gcc / gencheck.c
index 915f308..12cc038 100644 (file)
@@ -1,5 +1,5 @@
 /* Generate check macros for tree codes.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -23,20 +23,27 @@ Boston, MA 02111-1307, USA.  */
 
 #define DEFTREECODE(SYM, NAME, TYPE, LEN)   STRINGIFY(SYM),
 
-char *tree_codes[] = {
+const char *tree_codes[] = {
 #include "tree.def"
+#include "c-common.def"
 #include "gencheck.h"
 (char*)0
 };
 
-void usage ()
+static void usage PARAMS ((void));
+
+static void
+usage ()
 {
   fprintf (stderr,"Usage: gencheck\n");
 }
 
-int main (argc, argv)
+extern int main PARAMS ((int, char **));
+
+int
+main (argc, argv)
      int argc;
-     char *argv[] ATTRIBUTE_UNUSED;
+     char **argv ATTRIBUTE_UNUSED;
 {
   int i;
 
@@ -47,7 +54,7 @@ int main (argc, argv)
 
     default:
       usage ();
-      exit (1);
+      return (1);
     }
 
   printf ("/* This file is generated using gencheck. Do not edit. */\n");
@@ -55,8 +62,6 @@ int main (argc, argv)
     {
       printf ("#define %s_CHECK(t)\tTREE_CHECK (t, %s)\n",
              tree_codes[i], tree_codes[i]);
-      printf ("#define %s_CHECK1(t)\tTREE_CHECK1 (t, %s)\n",
-             tree_codes[i], tree_codes[i]);
     }
 
   return 0;
@@ -66,11 +71,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)
     {