On Wed, May 24, 2017 at 11:08 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, May 24, 2017 at 04:16:30PM +0200, Andreas Schwab wrote: >> FAIL: g++.dg/ext/integer-pack2.C -std=gnu++11 (test for excess errors) >> Excess errors: >> /daten/aranym/gcc/gcc-20170524/gcc/testsuite/g++.dg/ext/integer-pack2.C:10:48: >> error: overflow in constant expression [-fpermissive] >> /daten/aranym/gcc/gcc-20170524/gcc/testsuite/g++.dg/ext/integer-pack2.C:10:48: >> error: overflow in constant expression [-fpermissive] > > To be precise, it fails only on 32-bit targets.
> If we at that point want some wider integer that when cast to int > is 0 (or small enough positive number?), shall we use something like > this, or say 1LL << (sizeof (int) * __CHAR_BIT__), or 2LL * INT_MIN, > something else? This is fine. > Do we need to include <limits.h>? Or can we replace > INT_MAX with __INT_MAX__? __INT_MAX__ sounds good. > Not sure about that -2147483650 for 16-bit int targets (perhaps the test can > be guarded with int32 effective target). Yes, restricting the test to int32 seems like the easiest fix. Jason