-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler-gcc: Suppress -Wmissing-prototypes warning for all supported GCC #655
Conversation
Upstream branch: b4e59c1 |
902178a
to
bc1b833
Compare
Upstream branch: 3815f89 |
40304a8
to
be0420a
Compare
0fbe9f3
to
b0d20d2
Compare
Upstream branch: 6f101db |
be0420a
to
0dac02d
Compare
1e02037
to
a98cbca
Compare
Upstream branch: e80742d |
0dac02d
to
11f08fd
Compare
a98cbca
to
b7b6ef0
Compare
Upstream branch: e80742d |
11f08fd
to
a1538b4
Compare
b7b6ef0
to
293e027
Compare
Upstream branch: e80742d |
a1538b4
to
b8220a0
Compare
293e027
to
260b428
Compare
Upstream branch: e80742d |
b8220a0
to
b9eca27
Compare
260b428
to
08949e6
Compare
… GCC The kernel supports a minimum GCC version of 5.1.0 for building. However, the "__diag_ignore_all" directive only suppresses the "-Wmissing-prototypes" warning for GCC versions >= 8.0.0. As a result, when building the kernel with older GCC versions, warnings may be triggered. The example below illustrates the warnings reported by the kernel test robot using GCC 7.5.0: compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 All warnings (new ones prefixed by >>): kernel/bpf/helpers.c:1893:19: warning: no previous prototype for 'bpf_obj_new_impl' [-Wmissing-prototypes] __bpf_kfunc void *bpf_obj_new_impl(u64 local_type_id__k, void *meta__ign) ^~~~~~~~~~~~~~~~ kernel/bpf/helpers.c:1907:19: warning: no previous prototype for 'bpf_percpu_obj_new_impl' [-Wmissing-prototypes] __bpf_kfunc void *bpf_percpu_obj_new_impl(u64 local_type_id__k, void *meta__ign) [...] To address this, we should also suppress the "-Wmissing-prototypes" warning for older GCC versions. "#pragma GCC diagnostic push" is supported as of GCC 4.6, and both "-Wmissing-prototypes" and "-Wmissing-declarations" are supported for all the GCC versions that we currently support. Therefore, it is reasonable to suppress these warnings for all supported GCC versions. With this adjustment, it's important to note that after implementing "__diag_ignore_all", it will effectively suppress warnings for all the supported GCC versions. In the future, if you wish to suppress warnings that are only supported on higher GCC versions, it is advisable to explicitly use "__diag_ignore" to specify the GCC version you are targeting. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Yafang Shao <[email protected]> Cc: Kumar Kartikeya Dwivedi <[email protected]> Cc: Arnd Bergmann <[email protected]>
Upstream branch: 155addf |
b9eca27
to
75d0ecf
Compare
08949e6
to
3a8c9bf
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=798970 irrelevant now. Closing PR. |
Pull request for series with
subject: compiler-gcc: Suppress -Wmissing-prototypes warning for all supported GCC
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=798970