History

compiler_types: Move unused static inline functions warning to W=2

Per Nathan, clang catches unused "static inline" functions in C files since commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Linus said: > So I entirely ignore W=1 issues, because I think so many of the extra > warnings are bogus. > > But if this one in particular is causing more problems than most - > some teams do seem to use W=1 as part of their test builds - it's fine > to send me a patch that just moves bad warnings to W=2. > > And if anybody uses W=2 for their test builds, that's THEIR problem.. Here is the change to bump the warning from W=1 to W=2.

Peter Zijlstra committed 1 year ago

Commit 9818af11 parent a26a6c91 file · +2 −3Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/compiler_types.h+2−3
@@ -250,10 +250,9 @@ struct ftrace_likely_data { · 249 unmodified lines
250250 /*
251251 * GCC does not warn about unused static inline functions for -Wunused-function.
252252 * Suppress the warning in clang as well by using __maybe_unused, but enable it
253− * for W=1 build. This will allow clang to find unused functions. Remove the
254− * __inline_maybe_unused entirely after fixing most of -Wunused-function warnings.
253+ * for W=2 build. This will allow clang to find unused functions.
255254 */
256−#ifdef KBUILD_EXTRA_WARN1
255+#ifdef KBUILD_EXTRA_WARN2
257256 #define __inline_maybe_unused
258257 #else
259258 #define __inline_maybe_unused __maybe_unused

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t