This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/79358] gcc.dg/c99-stdint-1.c fails with excess error
- From: "vogt at linux dot vnet.ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Feb 2017 17:00:52 +0000
- Subject: [Bug c/79358] gcc.dg/c99-stdint-1.c fails with excess error
- Auto-submitted: auto-generated
- References: <bug-79358-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79358
--- Comment #6 from Dominik Vogt <vogt at linux dot vnet.ibm.com> ---
(In reply to Andreas Krebbel from comment #2)
> The reduced testcase fails with -m31 and -m64 but the original probably only
> with -m31 - right?!
Sorry, you're right. I was doing too many things in parallel.
Another attempt at reduction:
--
#include <limits.h>
#include <stdint.h>
#define CHECK_UNSIGNED(TYPE) \
do { TYPE a; int b[(TYPE)-1 < 0 ? -1 : 1]; } while (0)
#define CHECK_EXPR_TYPE(TYPE, EXPR) \
do { __typeof__(EXPR) a; __typeof__((TYPE)0 + 0) *b = &a; } while (0)
#define UNSIGNED_MAX_COND(TYPE, EXPR) \
((EXPR) == (TYPE)-1)
#define CHECK_UNSIGNED_LIMITS_2(TYPE, MAX, MAXBD) \
CHECK_UNSIGNED(TYPE); \
CHECK_EXPR_TYPE(TYPE, (MAX)); \
do { int a[(UNSIGNED_MAX_COND(TYPE, (MAX)) \
&& (MAX) >= (MAXBD)) ? 1 : -1]; } while (0)
void
test_misc_limits (void)
{
CHECK_UNSIGNED_LIMITS_2(__SIZE_TYPE__, SIZE_MAX, 65535U);
}
--