This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR bootstrap/53459 - unused local typedef when building on altivec
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Jason Merrill <jason at redhat dot com>, "Dominique d'Humieres" <dominiq at lps dot ens dot fr>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 May 2012 11:04:13 +0200
- Subject: Re: [PATCH] PR bootstrap/53459 - unused local typedef when building on altivec
- References: <m3ehq95lyv.fsf@redhat.com> <87pq9t70f7.fsf@fleche.redhat.com> <m3mx4w4r3p.fsf@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, May 25, 2012 at 10:11:54AM +0200, Dodji Seketeli wrote:
> --- a/libcpp/lex.c
> +++ b/libcpp/lex.c
> @@ -589,8 +589,8 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
>
> {
> #define N (sizeof(vc) / sizeof(long))
> -
> - typedef char check_count[(N == 2 || N == 4) * 2 - 1];
> + /* The below is a static assertion. */
> + extern char check_count[(N == 2 || N == 4) * 2 - 1];
> union {
> vc v;
> unsigned long l[N];
Alternatively you could put the static assertion with the comment
into the l field, i.e.
/* Statically assert that N is 2 or 4. */
unsigned long l[(N == 2 || N == 4) ? N : -1];
Jakub