This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C
- From: Ian Lance Taylor <iant at google dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 12 Aug 2010 21:15:56 -0700
- Subject: Re: Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C
- References: <AANLkTikZBWhhjno1kWG7eZzW27a3KsC9Jd-xoCZZsOOH@mail.gmail.com>
Uros Bizjak <ubizjak@gmail.com> writes:
> A problem arises with the code in testsuite/g++.dg/cpp0x/rv[1..8]p.C.
> These tests use "sizeof(..character array...) == <n>", but sizeof char
> array depends heavily on the value of #define STRUCTURE_SIZE_BOUNDARY.
> Targets that define this value to i.e. 32 (for performance reasons,
> instead of default BITS_PER_UNIT) will fail all these checks.
>
> Would it be acceptable to change all these checks from
>
> "sa<sizeof(foo(a)) == 1> t1;"
>
> to
>
> "sa<sizeof(foo(a)) != 0> t1;" ?
Sounds fine to me.
Ian