This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Valarrays and [altivec] vectors (was Re: [PATCH]: Handle vectormodes in genopinit.c, c-typeck.c)
- From: Jason Merrill <jason at redhat dot com>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: Gabriel Dos Reis <gdr at codesourcery dot com>, Phil Edwards <pedwards at disaster dot jaj dot com>, Per Bothner <per at bothner dot com>, Daniel Berlin <dan at cgsoftware dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 04 Dec 2001 17:13:24 +0000
- Subject: Re: Valarrays and [altivec] vectors (was Re: [PATCH]: Handle vectormodes in genopinit.c, c-typeck.c)
- References: <Pine.LNX.4.33.0111301344110.18267-100000@kern.srcf.societies.cam.ac.uk>
>>>>> "Joseph" == Joseph S Myers <jsm28@cam.ac.uk> writes:
> On 30 Nov 2001, Gabriel Dos Reis wrote:
>> That is a constraint violation in C++ as well, but then what should
>> happen if that constraint is violated? In C++, it is an undefined
>> behaviour. What do you propose for C?
> A hard compile-time error.
It should be a compile-time error in C++ as well, wherever possible. The
problem with that is that the size is not part of the type. Failing that,
we should throw length_error when we're in constraint-checking mode.
Jason