This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Include <inttypes.h> in libiberty/hashtab.c if available
- From: Rainer Orth <ro at techfak dot uni-bielefeld dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 15 Sep 2009 17:41:26 +0200 (MEST)
- Subject: PATCH: Include <inttypes.h> in libiberty/hashtab.c if available
On current mainline, bootstrap on alpha-dec-osf5.1b failed in stage1
building libiberty:
/vol/gcc/src/gcc-dist/libiberty/hashtab.c: In function `hash_pointer':
/vol/gcc/src/gcc-dist/libiberty/hashtab.c:199: error: `intptr_t' undeclared (first use in this function)
/vol/gcc/src/gcc-dist/libiberty/hashtab.c:199: error: (Each undeclared identifier is reported only once
/vol/gcc/src/gcc-dist/libiberty/hashtab.c:199: error: for each function it appears in.)
/vol/gcc/src/gcc-dist/libiberty/hashtab.c:199: error: parse error before "p"
This happens because while the platform has intptr_t, it is only defined in
<inttypes.h>. While the Autoconf test includes this header if available,
hashtab.c does not.
The following trivial patch fixes this and allows bootstrap to continue.
Ok for mainline?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
2009-09-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* hashtab.c [HAVE_INTTYPES_H]: Include <inttypes.h>.
Index: libiberty/hashtab.c
===================================================================
--- libiberty/hashtab.c (revision 151722)
+++ libiberty/hashtab.c (working copy)
@@ -50,6 +50,9 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif