This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Eliminate gansidecl.h, revised
- To: gcc-patches at gcc dot gnu dot org
- Subject: Eliminate gansidecl.h, revised
- From: "Zack Weinberg" <zackw at stanford dot edu>
- Date: Tue, 27 Mar 2001 22:26:16 -0800
Revised patch moving all the remaining logic out of gansidecl.h into
ansidecl.h. Should address all previous objections. Bootstrapped
i686-linux.
zw
gcc:
* gansidecl.h: All logic moved to include/ansidecl.h. Delete file.
* Makefile.in (intl.o): Don't depend on gansidecl.h.
* configure.in: Replace all references to gansidecl.h with
ansidecl.h. Explain to *_file_list generators that ansidecl.h
lives in $(srcdir)/../include.
* configure: Regenerate.
* defaults.h: Change comment to mention ansidecl.h.
* ggc.h, config/fr30/fr30.h, config/mcore/mcore.c: Don't
include gansidecl.h.
* intl.c, main.c, version.c, fixinc/fixlib.h,
fixinc/procopen.c, fixinc/server.c: Include ansidecl.h not
gansidecl.h.
gcc/java:
* Make-lang.in: Remove all references to gansidecl.h.
* buffer.c, jvgenmain.c: Don't include gansidecl.h.
gcc/po:
* POTFILES.in: Remove gansidecl.h from list.
include:
* ansidecl.h: All logic from gcc/gansidecl.h moved here.
libiberty:
* make-temp-file.c (try): Mark function inline.
===================================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in 2001/03/28 05:24:16 1.631
+++ gcc/Makefile.in 2001/03/28 06:12:46
@@ -1898,7 +1898,7 @@ $(HOST_PREFIX_1)ggc-none.o: ggc-none.c $
#
# Remake internationalization support.
-intl.o: intl.c intl.h gansidecl.h Makefile
+intl.o: intl.c intl.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DLOCALEDIR=\"$(localedir)\" \
-c $(srcdir)/intl.c
===================================================================
Index: gcc/configure.in
--- gcc/configure.in 2001/03/28 05:24:17 1.505
+++ gcc/configure.in 2001/03/28 06:12:47
@@ -592,11 +592,11 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/
gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked strstr environ \
malloc realloc calloc free basename getopt, , ,[
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"])
gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
@@ -802,9 +802,9 @@ else
fi
tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file}"
-build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file}"
-xm_file="gansidecl.h ${xm_file} ${tm_file}"
+host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
+build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
+xm_file="ansidecl.h ${xm_file} ${tm_file}"
# Truncate the target if necessary
if test x$host_truncate_target != x; then
@@ -975,7 +975,9 @@ out_object_file=`basename $out_file .c`.
tm_file_list=
for f in $tm_file; do
case $f in
- gansidecl.h | defaults.h )
+ ansidecl.h )
+ tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ defaults.h )
tm_file_list="${tm_file_list} $f" ;;
*) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
esac
@@ -989,7 +991,9 @@ done
host_xm_file_list=
for f in $host_xm_file; do
case $f in
- auto-host.h | gansidecl.h | defaults.h )
+ ansidecl.h )
+ host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ auto-host.h | defaults.h )
host_xm_file_list="${host_xm_file_list} $f" ;;
*) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
esac
@@ -998,7 +1002,9 @@ done
build_xm_file_list=
for f in $build_xm_file; do
case $f in
- auto-build.h | auto-host.h | gansidecl.h | defaults.h )
+ ansidecl.h )
+ build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+ auto-build.h | auto-host.h | defaults.h )
build_xm_file_list="${build_xm_file_list} $f" ;;
*) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
esac
===================================================================
Index: gcc/defaults.h
--- gcc/defaults.h 2001/03/18 21:38:32 1.33
+++ gcc/defaults.h 2001/03/28 06:12:47
@@ -161,7 +161,7 @@ do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNA
/* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
provide a weak attribute. Else define it to nothing.
- This would normally belong in gansidecl.h, but SUPPORTS_WEAK is
+ This would normally belong in ansidecl.h, but SUPPORTS_WEAK is
not available at that time.
Note, this is only for use by target files which we know are to be
===================================================================
Index: gcc/gansidecl.h
--- gcc/gansidecl.h Tue Mar 27 22:12:50 2001
+++ gcc/gansidecl.h Tue May 5 13:32:27 1998
@@ -1,52 +0,0 @@
-/* ANSI and traditional C compatibility macros.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
-
-/* This file mimics some of the support provided by include/ansidecl.h
- in binutils and gdb releases.
- ??? Over time the two should be merged into one. */
-
-#ifndef __GANSIDECL_H__
-#define __GANSIDECL_H__
-
-#include "ansidecl.h"
-
-/* Autoconf will possibly define the `inline' or `const' keywords as
- macros, however this is only valid for the stage1 compiler. If we
- detect a modern version of gcc, unconditionally reset the values.
- This makes sure the right thing happens in stage2 and later. We
- need to do this very early; i.e. before any systems header files or
- gcc header files in case they use these keywords. Otherwise
- conflicts might occur. */
-#if (GCC_VERSION >= 2007)
-# ifdef __STDC__
-# undef const
-# endif
-# undef inline
-# define inline __inline__ /* Modern gcc can use `__inline__' freely. */
-# ifndef HAVE_LONG_DOUBLE
-# define HAVE_LONG_DOUBLE 1
-# endif
-#endif /* GCC >= 2.7 */
-
-#ifndef NULL_PTR
-#define NULL_PTR ((PTR) 0)
-#endif
-
-#endif /* __GANSIDECL_H__ */
===================================================================
Index: gcc/ggc.h
--- gcc/ggc.h 2001/02/20 05:49:06 1.34
+++ gcc/ggc.h 2001/03/28 06:12:47
@@ -18,7 +18,6 @@ along with GNU CC; see the file COPYING.
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "gansidecl.h"
#include "varray.h"
/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
===================================================================
Index: gcc/intl.c
--- gcc/intl.c 1999/09/04 15:08:54 1.2
+++ gcc/intl.c 2001/03/28 06:12:47
@@ -1,6 +1,6 @@
/* intl.c - internationalization */
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "intl.h"
const char localedir[] = LOCALEDIR;
===================================================================
Index: gcc/main.c
--- gcc/main.c 2001/03/05 12:17:45 1.1
+++ gcc/main.c 2001/03/28 06:12:47
@@ -17,7 +17,7 @@ along with GNU CC; see the file COPYING.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "toplev.h"
int main PARAMS ((int argc, char **argv));
===================================================================
Index: gcc/version.c
--- gcc/version.c 2001/03/27 08:16:08 1.1180
+++ gcc/version.c 2001/03/28 06:12:47
@@ -1,4 +1,4 @@
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "version.h"
const char *const version_string = "3.1 20010327 (experimental)";
===================================================================
Index: gcc/config/fr30/fr30.h
--- gcc/config/fr30/fr30.h 2000/11/02 23:29:09 1.13
+++ gcc/config/fr30/fr30.h 2001/03/28 06:12:47
@@ -27,9 +27,6 @@ Boston, MA 02111-1307, USA. */
/* Set up System V.4 (aka ELF) defaults. */
#include "svr4.h"
-/* Include prototyping macros */
-#include "gansidecl.h"
-
/*}}}*/
/*{{{ Driver configuration. */
===================================================================
Index: gcc/config/mcore/mcore.c
--- gcc/config/mcore/mcore.c 2001/03/22 18:48:49 1.11
+++ gcc/config/mcore/mcore.c 2001/03/28 06:12:47
@@ -23,7 +23,6 @@ the Free Software Foundation, 675 Mass A
#include "tree.h"
#include "tm_p.h"
#include "assert.h"
-#include "gansidecl.h"
#include "mcore.h"
#include "regs.h"
#include "hard-reg-set.h"
===================================================================
Index: gcc/fixinc/fixlib.h
--- gcc/fixinc/fixlib.h 2001/03/03 19:05:00 1.21
+++ gcc/fixinc/fixlib.h 2001/03/28 06:12:49
@@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. */
#define FIXINCLUDES_FIXLIB_H
#include "auto-host.h"
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#include "gnu-regex.h"
===================================================================
Index: gcc/fixinc/procopen.c
--- gcc/fixinc/procopen.c 2000/12/13 20:07:46 1.7
+++ gcc/fixinc/procopen.c 2001/03/28 06:12:49
@@ -46,7 +46,7 @@
* If you do not wish that, delete this exception notice.
*/
#include "auto-host.h"
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#include "server.h"
===================================================================
Index: gcc/fixinc/server.c
--- gcc/fixinc/server.c 2001/03/10 04:20:03 1.19
+++ gcc/fixinc/server.c 2001/03/28 06:12:49
@@ -47,7 +47,7 @@
*/
#include "auto-host.h"
-#include "gansidecl.h"
+#include "ansidecl.h"
#include "system.h"
#include <signal.h>
===================================================================
Index: gcc/java/Make-lang.in
--- gcc/java/Make-lang.in 2001/03/27 22:57:33 1.55
+++ gcc/java/Make-lang.in 2001/03/28 06:12:49
@@ -242,12 +242,11 @@ java/gjavah.o: $(CONFIG_H) $(SYSTEM_H) $
java/jcf-reader.c java/jcf.h java/javaop.h version.h
java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(JAVA_TREE_H) \
java/parse.h
-java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h gansidecl.h \
- $(SYSTEM_H) toplev.h
-java/check-init.o: java/check-init.c $(CONFIG_H) gansidecl.h \
+java/buffer.o: java/buffer.c $(CONFIG_H) java/buffer.h $(SYSTEM_H) toplev.h
+java/check-init.o: java/check-init.c $(CONFIG_H) \
$(JAVA_TREE_H) $(SYSTEM_H) toplev.h
java/class.o: java/class.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \
- java/parse.h gansidecl.h toplev.h $(SYSTEM_H) output.h $(GGC_H)
+ java/parse.h toplev.h $(SYSTEM_H) output.h $(GGC_H)
java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
toplev.h $(SYSTEM_H) $(GGC_H)
java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
===================================================================
Index: gcc/java/buffer.c
--- gcc/java/buffer.c 1998/12/16 21:19:52 1.3
+++ gcc/java/buffer.c 2001/03/28 06:12:49
@@ -22,7 +22,6 @@ Boston, MA 02111-1307, USA. */
#include "config.h"
#include "system.h"
-#include "gansidecl.h"
#include "buffer.h"
/* Grow BUFP so there is room for at least SIZE more bytes. */
===================================================================
Index: gcc/java/jvgenmain.c
--- gcc/java/jvgenmain.c 2001/02/09 21:34:57 1.23
+++ gcc/java/jvgenmain.c 2001/03/28 06:12:49
@@ -27,7 +27,6 @@ The Free Software Foundation is independ
#include "config.h"
#include "system.h"
#include "obstack.h"
-#include "gansidecl.h"
#include "jcf.h"
#include "tree.h"
#include "java-tree.h"
===================================================================
Index: gcc/po/POTFILES.in
--- gcc/po/POTFILES.in 2000/12/17 06:30:40 1.39
+++ gcc/po/POTFILES.in 2001/03/28 06:12:49
@@ -619,7 +619,6 @@ frame.c
#frame.h is part of the GCC library
function.c
function.h
-gansidecl.h
#gbl-ctors.h is part of the GCC library
gcc.c
gcov-io.h
===================================================================
Index: include/ansidecl.h
--- include/ansidecl.h 2001/03/14 19:44:38 1.8
+++ include/ansidecl.h 2001/03/28 06:15:07
@@ -161,6 +161,15 @@ Foundation, Inc., 59 Temple Place - Suit
#endif /* ANSI C. */
+/* This is for GCC, which has historically used typed null pointer
+ constants. It needs to be here so it is seen by headers included
+ by gcc's config.h.
+
+ FIXME: GCC probably doesn't need to use typed nulls anymore.
+ Clean it up, then remove this. Ware variable-argument functions. */
+#ifdef IN_GCC
+# define NULL_PTR ((PTR) 0)
+#endif
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
older preprocessors. Thus we can't define something like this:
@@ -229,5 +238,24 @@ So instead we use the macro below and te
#if GCC_VERSION < 2008
#define __extension__
#endif
+
+/* Bootstrap support: Autoconf will possibly define the `inline' or
+ `const' keywords as macros, however this is only valid for the
+ stage1 compiler. If we detect a modern version of gcc,
+ unconditionally reset the values. This makes sure the right thing
+ happens in stage2 and later. We need to do this very early;
+ i.e. before any header files that might use these keywords.
+ Otherwise conflicts might occur. */
+
+#if (GCC_VERSION >= 2007)
+# ifdef __STDC__
+# undef const
+# endif
+# undef inline
+# define inline __inline__ /* __inline__ prevents -pedantic warnings */
+# ifndef HAVE_LONG_DOUBLE
+# define HAVE_LONG_DOUBLE 1
+# endif
+#endif /* GCC >= 2.7 */
#endif /* ansidecl.h */
===================================================================
Index: libiberty/make-temp-file.c
--- libiberty/make-temp-file.c 2001/03/21 19:29:33 1.2
+++ libiberty/make-temp-file.c 2001/03/28 06:15:08
@@ -61,9 +61,9 @@ extern int mkstemps PARAMS ((char *, int
If success, DIR is returned.
Otherwise NULL is returned. */
-static const char *try PARAMS ((const char *, const char *));
+static inline const char *try PARAMS ((const char *, const char *));
-static const char *
+static inline const char *
try (dir, base)
const char *dir, *base;
{