Clang: don't enable -Wzero-as-null-pointer-constant on 5.0.0
ClosedPublic

Authored by dfaure on Dec 20 2018, 7:08 PM.

Details

Summary

The clang compiler in Android NDK r15b, which has version 5.0.300080,
warns as follows:

warning: unknown warning option '-Wzero-as-null-pointer-constant'; did you mean '-Wint-to-void-pointer-cast'? [-Wunknown-warning-option]

Test Plan

Removing the option removes the warning

Diff Detail

Repository
R240 Extra CMake Modules
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6213
Build 6231: arc lint + arc unit
dfaure created this revision.Dec 20 2018, 7:08 PM
Restricted Application added projects: Frameworks, Build System. · View Herald TranscriptDec 20 2018, 7:08 PM
Restricted Application edited subscribers, added: kde-buildsystem, kde-frameworks-devel; removed: Build System, Frameworks. · View Herald Transcript
dfaure requested review of this revision.Dec 20 2018, 7:08 PM
krop accepted this revision.Dec 20 2018, 8:43 PM
This revision is now accepted and ready to land.Dec 20 2018, 8:43 PM
dfaure closed this revision.Dec 20 2018, 10:09 PM

Damn, I went too fast. This doesn't fix the issue.

CMake says 5.0.300080 is > 5.0.1, obviously.

The reason I enabled it for 5.0.1 is that on x86_64 linux, clang 5.0.1 does support it (but now I realize that 5.0.0 does too, most probably).
I don't understand what weird mess android does with the clang versioning, but apparently 5.0.3000080 is actually a kind of beta of 5.0.0.... https://stackoverflow.com/questions/47552782/llvm-version-on-ios-and-android seems to confirm that, in fact.

I guess the bug is my own fault, I didn't see there was a NDK 15c after 15b, so I guess one shouldn't use 15b at all.
I'll revert after confirming that it works with 15c, sorry for the noise.