[kdevplatform] Next step for use-nullptr
ClosedPublic

Authored by antonanikin on Oct 17 2016, 3:24 PM.

Details

Summary

The patch continues use-nullptr migration with changes for some parts of code which was not fixed by clang-tidy.

Unfortunately it's not possible now to enable "-Wzero-as-null-pointer-constant" flag without adding many ugly fixes to code. It causes by warnings/errors produced by this flag for 3rd-party, non-KDevelop code such a KF5, Qt which still use old-style zeroes instead nullptr.

Diff Detail

Repository
R33 KDevPlatform
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
antonanikin updated this revision to Diff 7464.Oct 17 2016, 3:24 PM
antonanikin retitled this revision from to Final step for use-nullptr.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added a reviewer: KDevelop.
antonanikin set the repository for this revision to R33 KDevPlatform.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptOct 17 2016, 3:24 PM
kfunk requested changes to this revision.Oct 17 2016, 3:32 PM
kfunk added a reviewer: kfunk.
kfunk added a subscriber: kfunk.

Some look like they shouldn't be needed. Could you explain why they are...?

shell/tests/test_sessioncontroller.cpp
97 ↗(On Diff #7464)

Dito: Why are these needed?

sublime/tests/test_areaoperation.cpp
198 ↗(On Diff #7464)

Uh oh, why are these needed?

This revision now requires changes to proceed.Oct 17 2016, 3:32 PM
antonanikin added inline comments.Oct 17 2016, 3:37 PM
shell/tests/test_sessioncontroller.cpp
97 ↗(On Diff #7464)

Without this (ugly) params we has warning/error with enabled "zero-as-null-pointer-constant" flag :(

sublime/tests/test_areaoperation.cpp
198 ↗(On Diff #7464)

same as above. This is because of using zero for nullptr in external libs like KF5, Qt,... :(

kfunk added a comment.Oct 17 2016, 3:56 PM

@antonanikin We should fix the external libs then -- I don't like adding boiler plate code in kdevplatform just to fix issues in external libs.

-Wzero-as-null-pointer-constant should not warn for "system" headers... Is that a GCC bug?

I don't like adding boiler plate code in kdevplatform just to fix issues in external libs.

+1, it's ugly

-Wzero-as-null-pointer-constant should not warn for "system" headers... Is that a GCC bug?

I don't know. But with gcc-6.2.1 this flag produce warnings/errors for such cases (includes).

As a result I suggest drop "-Wno-error=zero-as-null-pointer-constant" from patch and clean it from redundant lines.

antonanikin updated this revision to Diff 7479.Oct 18 2016, 2:00 AM
antonanikin retitled this revision from Final step for use-nullptr to Next step for use-nullptr.
antonanikin updated this object.
antonanikin edited edge metadata.
antonanikin retitled this revision from Next step for use-nullptr to [kdevplatform] Next step for use-nullptr.Oct 18 2016, 3:01 AM
antonanikin edited edge metadata.
kfunk accepted this revision.Oct 18 2016, 7:13 AM
kfunk edited edge metadata.
This revision is now accepted and ready to land.Oct 18 2016, 7:13 AM
This revision was automatically updated to reflect the committed changes.