This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jul 2004 04:11:47 -0400
- Subject: [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-ISOC99 systems)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Ok to commit?
complex.h include has been there just as a left over from test development
(and compat-common.h takes care of including complex.h if necessary),
stdint.h was needed just for uintptr_t, but as the test is usually testing
just a few bottom-most bits of it, I think it can cast to long as well.
If sizeof (long) is not equal to sizeof (void *), the compiler might issue
a warning, but the tests are run with -w.
2004-07-30 Jakub Jelinek <jakub@redhat.com>
PR other/16820
* gcc.dg/compat/struct-layout-1.h: Don't include complex.h nor
stdint.h.
* gcc.dg/compat/struct-layout-1_x1.h (TX): Cast to long instead of
uintptr_t.
--- gcc/testsuite/gcc.dg/compat/struct-layout-1.h.jj 2004-07-23 14:35:43.000000000 +0200
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1.h 2004-07-30 09:17:06.624834793 +0200
@@ -1,9 +1,7 @@
-#include <complex.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "compat-common.h"
--- gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h.jj 2004-07-13 20:35:54.000000000 +0200
+++ gcc/testsuite/gcc.dg/compat/struct-layout-1_x1.h 2004-07-30 09:46:21.861615761 +0200
@@ -56,7 +56,7 @@ void test##n (void) \
info.als = __alignof__ (s##n); \
info.ala0 = __alignof__ (a##n[0]); \
info.ala3 = __alignof__ (a##n[3]); \
- if (((uintptr_t) &a##n[3]) & (info.als - 1)) \
+ if (((long) &a##n[3]) & (info.als - 1)) \
FAIL (n, 1); \
i = 0; j = 0; \
ops \
Jakub