summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 09:42:39 +0000
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-29 09:42:39 +0000
commit5fe44548c9c320d07f03fc6813dc7c4f41291e84 (patch)
tree22ecca7d0d8158b330cd0d3d03f9480bcb1829db
parent40e83228d9e0c139a4496548260568cd4575d6de (diff)
downloadgcc-5fe44548c9c320d07f03fc6813dc7c4f41291e84.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187947 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/lex.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 0d25c4d633f..859c1a43cce 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -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
diff --git a/libcpp/lex.c b/libcpp/lex.c
index c4dd6035c9b..98ee4e92da3 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;