[Interest] clang 3.2, -Wunused-private-field and qtestspontaneevent.h

Jan Kundrát jkt at flaska.net
Thu Jan 17 11:24:32 CET 2013


Hi,
I've upgraded to clang 3.2 from 3.0 and am getting these build warnings when using -Wall -Wextra:

In file included from /usr/include/qt4/QtTest/QTest:1:                                                                                                                                                                                                                                                                       
In file included from /usr/include/qt4/QtTest/qtest.h:252:                                                                                                                                                                                                                                                                   
In file included from /usr/include/qt4/QtTest/qtest_gui.h:55:                                                                                                                                                                                                                                                                
In file included from /usr/include/qt4/QtTest/qtestevent.h:52:                                                                                                                                                                                                                                                               
In file included from /usr/include/qt4/QtTest/qtestkeyboard.h:53:                                                                                                                                                                                                                                                            
/usr/include/qt4/QtTest/qtestspontaneevent.h:108:12: warning: private field 'posted' is not used [-Wunused-private-field]                                                                                                                                                                                                    
    ushort posted : 1;                                                                                                                                                                                                                                                                                                       
           ^                                                                                                                                                                                                                                                                                                                 
/usr/include/qt4/QtTest/qtestspontaneevent.h:110:12: warning: private field 'm_accept' is not used [-Wunused-private-field]                                                                                                                                                                                                  
    ushort m_accept : 1;                                                                                                                                                                                                                                                                                                     
           ^                                                                                                                                                                                                                                                                                                                 
/usr/include/qt4/QtTest/qtestspontaneevent.h:111:12: warning: private field 'reserved' is not used [-Wunused-private-field]                                                                                                                                                                                                  
    ushort reserved : 13;                                                                                                                                                                                                                                                                                                    
           ^ 

I understand that these fields are needed for ABI compatibility. Still, they are causing three warnings for each unit test that I compile. What would be the easiest way out of there, preferably without disabling that warning globally?

A few "fixes" come to my mind:

- blame clang,
- make these protected,
- Somehow tell clang that /usr/include/qt4/ is part of "the system" and there is no point in issuing warning for that. I haven't had luck in achieving this under GCC, not sure if clang is any better.

With kind regards,
Jan

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/



More information about the Interest mailing list