OSDN Git Service

PR bootstrap/53459 - unused local typedef when building on altivec
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 May 2012 09:42:39 +0000 (09:42 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 May 2012 09:42:39 +0000 (09:42 +0000)
PR bootstrap/53459
* lex.c (search_line_fast): Avoid unused local typedefs to simulate
a static assertion.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187947 138bc75d-0d04-0410-961f-82ee72b054a4

libcpp/ChangeLog
libcpp/lex.c

index 0d25c4d..859c1a4 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-25  Dodji Seketeli  <dodji@redhat.com>
+
+       PR bootstrap/53459
+       * lex.c (search_line_fast): Avoid unused local typedefs to simulate
+       a static assertion.
+
 2012-05-29  Dodji Seketeli  <dodji@redhat.com>
 
        PR preprocessor/53229
index c4dd603..98ee4e9 100644 (file)
@@ -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;