From 53a103d30410e9e31e46576a189fa83c4733c45a Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Tue, 29 May 2012 09:42:39 +0000 Subject: PR bootstrap/53459 - unused local typedef when building on altivec PR bootstrap/53459 * lex.c (search_line_fast): Avoid unused local typedefs to simulate a static assertion. From-SVN: r187947 --- libcpp/ChangeLog | 6 ++++++ libcpp/lex.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'libcpp') diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 0d25c4d..859c1a4 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2012-05-25 Dodji Seketeli + + PR bootstrap/53459 + * lex.c (search_line_fast): Avoid unused local typedefs to simulate + a static assertion. + 2012-05-29 Dodji Seketeli PR preprocessor/53229 diff --git a/libcpp/lex.c b/libcpp/lex.c index c4dd603..98ee4e9 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -590,10 +590,10 @@ 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]; union { vc v; - unsigned long l[N]; + /* Statically assert that N is 2 or 4. */ + unsigned long l[(N == 2 || N == 4) ? N : -1]; } u; unsigned long l, i = 0; -- cgit v1.1