PR 13358 long long and C++ do not mix well

Janis Johnson janis187@us.ibm.com
Wed Aug 27 22:27:00 GMT 2008


On Tue, 2008-08-26 at 21:30 +0200, Manuel López-Ibáñez wrote:
> 2008/8/25 Mark Mitchell <mark@codesourcery.com>:
> >
> > Why are you using -m32 here?  That's not going to work on lots of CPU
> > targets, and I don't understand why it's a required part of the test.
> 
> Without -m32 I don't get the errors for the unsufixed constants even
> with -pedantic-errors (I guess because sizeof(long long) ==
> sizeof(long). I guess the test would work in 32bits targets without
> -m32 but it will fail in 64bit targets.
> 
> I could restrict the test to 32bits targets with
> require-effective-target ilp32 but then I cannot test it (I only have
> access to x86_64)
> 
> What would be the dg-* magic to:
> 
> * enable -m32 for targets that support it and where sizeof(long long)
> == sizeof(long)
> * enable the test for targets where sizeof(long long) != sizeof(long)
> * disable the test for the rest.

A test should never use -m32 or -m64 explicitly because many people
test with -m32 and again with -m64, for example with

  make -k RUNTESTFLAGS="--target_board=unix'{-m32,-m64}'" check

You could restrict the test to ilp32 (and int16?) with

  { dg-skip-if "long same length as long long" { ! { ilp32 || int16 } } "*" "" }

Janis



More information about the Gcc-patches mailing list