If I use -Werror for compiling my program which uses cppunit it is not compiling. The error is: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] ... note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ This is because of line 520 and following in TestAssert.h: if ( cpputCorrectExceptionThrown_ ) \ break; \ CPPUNIT_NS::Asserter::fail( cpputMsg_, \ CPPUNIT_SOURCELINE() ); \ Here everything will be in one line for the compiler because of the macro implementation and only the break is inside of the if body and not the following stuff but it seems like the following has also to be in the if body. This can be fixed with easy adding some brackets: if ( cpputCorrectExceptionThrown_ ) \ { break; } \ CPPUNIT_NS::Asserter::fail( cpputMsg_, \ CPPUNIT_SOURCELINE() ); \
Created attachment 148224 [details] Added some brackets to make it more clear for the compile which things belongs to the if body
@Markus, @Stephan Bergmann, any opinion here ?
Thanks Tobias. The patch has been added to the upstream repository as https://cgit.freedesktop.org/libreoffice/cppunit/commit/?id=51efd6f2184405dea29265ea0dd25c71b348404a