Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
efi: de-inline xmalloc to fix build failure with gcc 12.2 and -O2
With meson build --werror --buildtype=plain -Dc_args=" -O2" the build fails: ../src/boot/efi/stub.c: In function ‘load_addons.constprop’:03:06 ../src/boot/efi/stub.c:475:40: error: using a dangling pointer to ‘p’ [-Werror=dangling-pointer=]03:06 475 | dt_bases[n_dt] = xmemdup((uint8_t*)loaded_addon->ImageBase + addrs[UNIFIED_SECTION_DTB],03:06 | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~03:06 476 | dt_sizes[n_dt]);03:06 | ~~~~~~~~~~~~~~~03:06 In file included from ../src/boot/efi/stub.c:20:03:06 ../src/boot/efi/util.h:33:15: note: ‘p’ declared here03:06 33 | void *p;03:06 | ^ De-inline the function and initialize p to make gcc happy. (cherry picked from commit 6036f62) (cherry picked from commit 4cf3445) (cherry picked from commit 4211a29)
- Loading branch information