D5430: KDECompilerSettings: Pass -Wvla & -Wdate-time
Michael Pyne
noreply at phabricator.kde.org
Sat Apr 15 00:41:18 UTC 2017
mpyne accepted this revision.
mpyne added a comment.
This revision is now accepted and ready to land.
I think these warning flags make sense as default warning flags. I don't agree that `__DATE__` and `__TIME__` should be avoided as a rule, but projects that find this valuable can disable the warning as appropriate (e.g. with a "developer mode" option) and make alternative provisions for reproducible builds (for packagers or those auditing the binaries generated by others).
INLINE COMMENTS
> KDECompilerSettings.cmake:376
> +endif()
> +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5))
> + # -Wdate-time: warn if we use __DATE__ or __TIME__ (we want to be able to reproduce the exact same binary)
The CMake docs seem to say that the operator precedence of OR vs AND will do what you mean here for the GCC version check. But still, if you're going to defensively parenthesize the Clang version check (and I agree with doing so), you should also do the same for the GCC version check. That way we don't have to check the CMake docs to make sure it's right. :)
REPOSITORY
R240 Extra CMake Modules
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D5430
To: kfunk, mpyne
Cc: mpyne, #frameworks, #build_system
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20170415/a3a31af2/attachment.html>
More information about the Kde-buildsystem
mailing list