From ba191b0a26b966ad1fb596a905307399922bc44a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 21 Jul 2009 14:28:01 +0200 Subject: Fix warning with Sun CC 5.9 and xlC 7: no new types inside anonymous unions. These compilers compile this code fine, but this warning shows up *everywhere* when building Qt (or used to, since qstringlist.h included qstringmatcher.h). Move the structure definition to outside the union. --- src/corelib/tools/qstringmatcher.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qstringmatcher.h b/src/corelib/tools/qstringmatcher.h index 2b8edc9..61b7a95 100644 --- a/src/corelib/tools/qstringmatcher.h +++ b/src/corelib/tools/qstringmatcher.h @@ -81,13 +81,14 @@ private: // explicitely allow anonymous unions for RVCT to prevent compiler warnings #pragma anon_unions #endif + struct Data { + uchar q_skiptable[256]; + const QChar *uc; + int len; + }; union { uint q_data[256]; - struct { - uchar q_skiptable[256]; - const QChar *uc; - int len; - } p; + Data p; }; }; -- cgit v0.12