diff options
author | Eder Zulian <ezulian@redhat.com> | 2024-10-22 19:23:29 +0200 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2024-10-23 14:38:34 -0700 |
commit | 7a4ffec9fd54ea27395e24dff726dbf58e2fe06b (patch) | |
tree | 291729823d367fb807f2fe37b060777f0dcb6b0f /lib/crypto/mpi/mpi-mul.c | |
parent | 7f4ec77f3fee41dd6a41f03a40703889e6e8f7b2 (diff) | |
download | linux-7a4ffec9fd54ea27395e24dff726dbf58e2fe06b.tar.gz linux-7a4ffec9fd54ea27395e24dff726dbf58e2fe06b.tar.bz2 linux-7a4ffec9fd54ea27395e24dff726dbf58e2fe06b.zip |
libsubcmd: Silence compiler warning
Initialize the pointer 'o' in options__order to NULL to prevent a
compiler warning/error which is observed when compiling with the '-Og'
option, but is not emitted by the compiler with the current default
compilation options.
For example, when compiling libsubcmd with
$ make "EXTRA_CFLAGS=-Og" -C tools/lib/subcmd/ clean all
Clang version 17.0.6 and GCC 13.3.1 fail to compile parse-options.c due
to following error:
parse-options.c: In function ‘options__order’:
parse-options.c:832:9: error: ‘o’ may be used uninitialized [-Werror=maybe-uninitialized]
832 | memcpy(&ordered[nr_opts], o, sizeof(*o));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
parse-options.c:810:30: note: ‘o’ was declared here
810 | const struct option *o, *p = opts;
| ^
cc1: all warnings being treated as errors
Signed-off-by: Eder Zulian <ezulian@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20241022172329.3871958-4-ezulian@redhat.com
Diffstat (limited to 'lib/crypto/mpi/mpi-mul.c')
0 files changed, 0 insertions, 0 deletions