Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 v2
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 6ff4a0f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 6ff4a0f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 3547a61
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 8cd189e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 815276d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

This fixes the build with -Werror -Wall.

btf_dumper.c:71:31: error: variable 'finfo' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
   71 |         info.func_info = ptr_to_u64(&finfo);
      |                                      ^~~~~

prog.c:2294:31: error: variable 'func_info' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
 2294 |         info.func_info = ptr_to_u64(&func_info);
      |

v2:
  - Initialize instead of using memset.

Signed-off-by: Tom Stellard <[email protected]>
Acked-by: Quentin Monnet <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 57cb269
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 5612ea8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=1003492
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 v2
Using index info to reconstruct a base tree...
M	tools/bpf/bpftool/btf_dumper.c
M	tools/bpf/bpftool/prog.c
Falling back to patching base and 3-way merge...
Auto-merging tools/bpf/bpftool/prog.c
CONFLICT (content): Merge conflict in tools/bpf/bpftool/prog.c
Auto-merging tools/bpf/bpftool/btf_dumper.c
CONFLICT (content): Merge conflict in tools/bpf/bpftool/btf_dumper.c
Patch failed at 0001 bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 v2'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"'

conflict:

diff --cc tools/bpf/bpftool/btf_dumper.c
index ff12628593ae,89715c32a1a3..000000000000
--- a/tools/bpf/bpftool/btf_dumper.c
+++ b/tools/bpf/bpftool/btf_dumper.c
@@@ -38,6 -38,8 +38,11 @@@ static int dump_prog_id_as_func_ptr(con
  	__u32 info_len = sizeof(info);
  	const char *prog_name = NULL;
  	struct btf *prog_btf = NULL;
++<<<<<<< HEAD
++=======
+ 	/* Initialize finfo to silence -Wuninitialized-const-pointer warning
+ 	 * in clang >= 21. */
++>>>>>>> bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 v2
  	struct bpf_func_info finfo = {};
  	__u32 finfo_rec_size;
  	char prog_str[1024];
diff --cc tools/bpf/bpftool/prog.c
index 4dccc75b0bab,2540f570a38b..000000000000
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@@ -2262,6 -2216,8 +2262,11 @@@ static void profile_print_readings(void
  
  static char *profile_target_name(int tgt_fd)
  {
++<<<<<<< HEAD
++=======
+ 	/* Initialize func_info to silence -Wuninitialized-const-pointer
+ 	 * warning in clang >= 21. */
++>>>>>>> bpftool: Fix -Wuninitialized-const-pointer warnings with clang >= 21 v2
  	struct bpf_func_info func_info = {};
  	struct bpf_prog_info info = {};
  	__u32 info_len = sizeof(info);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants