public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C
@ 2010-08-10 16:48 Uros Bizjak
  2010-08-13 10:41 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2010-08-10 16:48 UTC (permalink / raw)
  To: GCC Development

Hello!

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;" ?

Uros.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C
  2010-08-10 16:48 Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C Uros Bizjak
@ 2010-08-13 10:41 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2010-08-13 10:41 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: GCC Development

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-08-13  4:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-10 16:48 Usage of sizeof in testsuite/g++.dg/cpp0x/rv[1..8]p.C Uros Bizjak
2010-08-13 10:41 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).