https://bugs.documentfoundation.org/show_bug.cgi?id=122639

            Bug ID: 122639
           Summary: With gcc flag -Werror programs are not compiling using
                    the lib
           Product: cppunit
           Version: 1.14
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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() );                \

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to