[Webkit-unassigned] [Bug 246246] New: [CMake] Selectively treat some warnings as errors
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Oct 8 04:16:08 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=246246
Bug ID: 246246
Summary: [CMake] Selectively treat some warnings as errors
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Tools / Tests
Assignee: webkit-unassigned at lists.webkit.org
Reporter: aperez at igalia.com
There are certain compiler warnings that we would like to have always
treated as errors, but at the same time treating *all* warnings as
errors with -Werror can be complicated (see #155047 for discussion
on this topic).
Nevertheless, there may be certain warnings that we would prefer to
*always* have as errors in developer builds, even in those cases
where DEVELOPER_MODE_FATAL_WARNINGS is disabled. With -Werror=name
we can selectively opt-in to those we want to keep at bay no matter
what.
This idea crossed my mind when I discovered Clang has now some handy
warnings:
-Wundefined-internal
-Wundefined-inline
-Wundefined-func-template
These will warn if a static function, an inline function, or a function
template have been forward-declared, but the definition has not been
brought into scope in the compilation unit where they are used. This
currently continues building, but results in linker errors which are
most of the time cryptic and do not directly point to the issue at hand.
Coincidentally: a reason why I used LLD first for years, and a while
ago I imported the Mold linker in the Flatpak SDK is because they tend
to provide slightly better diagnostics for this kind of thing--but the
compiler erroring earlier makes *so much easier* to fix things!
So at first I would want to add the above three with -Werror=name to
CMake developer builds, see how that goes, and maybe later start adding
more opt-ins for treating warnings as errors. Hopefully slowly boiling
the frog this way can get steer us towards DEVELOPER_MODE_FATAL_WARNINGS
being always enabled :)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221008/937175ea/attachment.htm>
More information about the webkit-unassigned
mailing list