This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix WINT_TYPE for FreeBSD (was: stdint.h type information needed)
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: gcc-patches at gcc dot gnu dot org, Loren James Rittle <ljrittle at gmail dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 2 Jun 2009 11:36:38 +0200 (CEST)
- Subject: Fix WINT_TYPE for FreeBSD (was: stdint.h type information needed)
- References: <Pine.LNX.4.64.0904010037220.9650@digraph.polyomino.org.uk>
On Wed, 1 Apr 2009, Joseph S. Myers wrote:
> Make sure the new c99-stdint-*.c tests pass; if they show up bugs in
> the system's stdint.h header (as wrapped by GCC with the "wrap" setting)
> then report those upstream and fix them in GCC with fixincludes.
After my patch for stdint.h support on FreeBSD has gone in, we are
nearly fine on that front. Nearly, because as we see from
http://gcc.gnu.org/ml/gcc-testresults/2009-06/msg00031.html
gcc.dg/c99-stdint-1.c and gcc.dg/c99-stdint-7.c still fail with
.../gcc/testsuite/gcc.dg/c99-stdint-1.c: In function 'test_misc_limits':
.../gcc/testsuite/gcc.dg/c99-stdint-1.c:219: error: size of array 'a'is negative
and
.../gcc/testsuite/gcc.dg/c99-stdint-7.c:213: error: #error "WINT_MIN not usable in #if or wrong value"
.../gcc/testsuite/gcc.dg/c99-stdint-7.c:216: error: #error "WINT_MAX not usable in #if or wrong value"
Both of these relate to WINT_MIN and WINT_MAX, and indeed we have
WINT_MIN = -2147483648, __WINT_MIN__ = 0
WINT_MAX = 2147483647, __WINT_MAX__ = 4294967295
The patch below fixes this and resolves the following testcases without
any other regressions on i386-unknown-freebsd7.1:
< FAIL: gcc.dg/c99-stdint-1.c (test for excess errors)
< FAIL: gcc.dg/c99-stdint-7.c (test for excess errors)
< FAIL: gcc.dg/wint_t-1.c (test for excess errors)
Okay for trunk? Should this also be applied to open release branches?
Gerald
2009-06-02 Gerald Pfeifer <gerald@pfeifer.com>
* config/freebsd.h: Update comment on types.
(WINT_TYPE): Define.
Index: config/freebsd.h
===================================================================
--- config/freebsd.h (revision 148068)
+++ config/freebsd.h (working copy)
@@ -68,11 +68,14 @@
#undef NO_IMPLICIT_EXTERN_C
#define NO_IMPLICIT_EXTERN_C 1
-/* Make gcc agree with FreeBSD's standard headers (<machine/ansi.h>, etc...) */
+/* Make GCC agree with FreeBSD's standard headers (<sys/_types.h> etc...) */
#undef WCHAR_TYPE
#define WCHAR_TYPE "int"
+#undef WINT_TYPE
+#define WINT_TYPE "int"
+
#define MATH_LIBRARY_PROFILE "-lm_p"
/* Code generation parameters. */