12-29-2021, 01:29 AM
Code:
CC net/tftp.o
lib/avb/libavb/avb_slot_verify.c: In function 'load_and_verify_vbmeta':
lib/avb/libavb/avb_slot_verify.c:476:40: error: 'found' may be used uninitialized in this function [-Werror=maybe-uninitialized]
476 | loaded_partition->partition_name = avb_strdup(found);
| ^~~~~~~~~~~~~~~~~
lib/avb/libavb/avb_slot_verify.c:299:15: note: 'found' was declared here
299 | const char* found;
| ^~~~~
CC drivers/video/drm/analogix_dp.o
LD net/built-in.o
CC test/dm/cmd_dm.o
LD test/dm/built-in.o
CC drivers/video/drm/analogix_dp_reg.o
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:280: lib/avb/libavb/avb_slot_verify.o] エラー 1
make[1]: *** [scripts/Makefile.build:425: lib/avb/libavb] エラー 2
make: *** [Makefile:1305: lib] エラー 2
make: *** 未完了のジョブを待っています....
LD drivers/watchdog/built-in.o
CC drivers/video/drm/rockchip_lvds.o
CC drivers/video/drm/rockchip_panel.o
LD drivers/video/drm/built-in.o
LD drivers/video/built-in.o
LD drivers/built-in.o
Technically speaking that char *found in lib/avg/libavb/avb_slot_verify.c line 299 is being used without being initialized, at least as far as the compiler is concerned. Combined with the -Werror=maybe-uninitialized flag, what would normally be a warning is being treated as an error.
A quick fix would be to add "= NULL" to the declaration on line 299 so it is always initialized, e.g.
char * found = NULL;