Martin Bosticky - 2002-04-26

Hi everyone

I created a project that uses CppUnit 1.8.0 and got many warning errors when i set to warning lever 4.

I then put #pragma statements around the include files like so:

#pragma warning (push, 3)
#include <cppunit/TestCase.h>
#include <cppunit/TestSuite.h>
#include <cppunit/TestCaller.h>
#include <cppunit/TestAssert.h>
#pragma warning (pop)


#pragma warning (push, 3)
#include <cppunit/TextTestResult.h>
#pragma warning (pop)

There were 6 warnings left with first related to "deque" and "CppUnit::TestListener *".

Then i drop back to warning lever 3 and get the same errors at this level. After 6 hours of tearing my hair out, i start wondering what IF? and remove the #pragma statements from the CppUnit include files and again BuildAll still at warning level 3. This time i get no warnings at all!

Thus somehow, putting #pragma blocks around CppUnit include files when compiling at warning level 3 can triger 6 warnings. Removing the #pragma blocks removes the warnings.

Is there an explanation for this? Presumably there is something nasty in the CppUnit include files? Has anybody seen such behaviour before?

For me this means that my cppunit testing program will have to be compiled at warning lever 3 for now. However warning level 4 is allways desirable.

Cheers, Martin.