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

            Bug ID: 100157
           Summary: Compilling with gcc flag
                    -Wzero-as-null-pointer-constant triggers warnings
           Product: cppunit
           Version: 1.13
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 125410
  --> https://bugs.documentfoundation.org/attachment.cgi?id=125410&action=edit
Patch proposal

I'm currently building our project with gcc 5.2.

Using cppunit cppunit/extensions/HelperMacros.h header with gcc flag
-Wzero-as-null-pointer-constant triggers warnings:

[...]include/cppunit/extensions/HelperMacros.h:171:31: error: zero as null
pointer constant [-Werror=zero-as-null-pointer-constant]
  CppUnitExDeleter() : suite (0) {}           \
                              ^

[...]include/cppunit/extensions/HelperMacros.h:174:45: error: zero as null
pointer constant [-Werror=zero-as-null-pointer-constant]
   CPPUNIT_NS::TestSuite *tmp = suite; suite = NULL; return tmp;  \
                                                ^

As stated in gcc documentation, this warning is used to facilitate the
conversion to nullptr in C++11 [1]

Using nullptr is the c++11 way to initialize pointers with null value [2].

I've created a patch for the branch feature/c++11.

[1] https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/Warning-Options.html
[2] http://en.cppreference.com/w/cpp/language/nullptr

-- 
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