From: Dodji Seketeli Date: Tue, 29 May 2012 09:42:39 +0000 (+0000) Subject: PR bootstrap/53459 - unused local typedef when building on altivec X-Git-Tag: misc/gccgo-go1_1_2~2671 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53a103d30410e9e31e46576a189fa83c4733c45a;p=thirdparty%2Fgcc.git 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 --- diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 0d25c4d633fc..859c1a43ccec 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 c4dd6035c9bd..98ee4e92da39 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;