Dear coreboot folks,
Clang 5.0 shows the warnings below. I don’t know if Clang 4.0 also warns about these.
``` CC firmware/lib/vboot_api_kernel.o firmware/lib/vboot_api_kernel.c:334:26: error: taking address of packed member 'kernel_version_tpm' of class or structure 'VbSharedDataHeader' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (RollbackKernelRead(&shared->kernel_version_tpm)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ firmware/lib/vboot_api_kernel.c:512:16: error: implicit conversion from enumeration type 'enum vb2_nv_param' to different enumeration type 'VbNvParam' (aka 'enum VbNvParam') [-Werror,-Wenum-conversion] VbNvGet(&vnc, VB2_NV_DEV_BOOT_FASTBOOT_FULL_CAP, ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. ```
Thanks,
Paul
Dear Paul,
* Paul Menzel paulepanter@users.sourceforge.net [171007 11:05]:
Dear coreboot folks,
Clang 5.0 shows the warnings below. I don’t know if Clang 4.0 also warns about these.
CC firmware/lib/vboot_api_kernel.o firmware/lib/vboot_api_kernel.c:334:26: error: taking address of packed member 'kernel_version_tpm' of class or structure 'VbSharedDataHeader' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (RollbackKernelRead(&shared->kernel_version_tpm)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~ firmware/lib/vboot_api_kernel.c:512:16: error: implicit conversion from enumeration type 'enum vb2_nv_param' to different enumeration type 'VbNvParam' (aka 'enum VbNvParam') [-Werror,-Wenum-conversion] VbNvGet(&vnc, VB2_NV_DEV_BOOT_FASTBOOT_FULL_CAP, ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated.
Clang is not currently supported by coreboot. However, if you wish to contribute a patch to fix above issues, it will probably get merged.
Stefan