loplugin:nullptr

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 25 September 2014 10:43 UTC

A plugin to warn about and rewrite null pointer constants that are not written as nullptr (in C++11 code) resp. NULL (in C and C++03 code). It is not activated for the following reasons:

- At least the call to

pImpl->aFmtNms.insert(pImpl->aFmtNms.begin() + nPos, nullptr);

in svx/source/items/clipfmtitem.cxx would require "missing std::nullptr_t support in boost/type_traits/is_pointer.hpp" to be fixed first.

- Additions of code that violate the plugin would probably be frequent, causing unnecessary grief for those building with plugins enabled.

- It did not find anything interesting, apart from the above Boost bug and the mildly interesting 1da153b617b80887680be65c1854ef8080c2e1c9 "Consistently use APP_WRITER as an integer, never as a nullptr."

Anyway,

until make -O -j4 -k check; do make -O -j1 -k check \ COMPILER_PLUGIN_TOOL=nullptr UPDATE_FILES=all; done

sucessfully executed on a recent master and resulted in

6798 files changed, 60919 insertions(+), 60919 deletions(-)

5a9a3da loplugin:nullptr
compilerplugins/clang/store/nullptr.cxx | 211 +++++++++++++++++++++++++++++++
1 file changed, 211 insertions(+)

Upstream: cgit.freedesktop.org


  • Share