[edk2-devel] [PATCH v4 2/5] UefiCpuPkg/SmmBaseHob.h: Add SMM Base HOB Data

Marvin Häuser mhaeuser at posteo.de
Fri Feb 10 08:47:29 UTC 2023


Hi Ray and Jiaxin,

Quick reminder that [1] invokes undefined behaviour and [0] is not legal C, but a compiler extension. The canonical way is a flexible array member using [].

Off-topic and nitpicking, but I started wondering why so many structures are packed. For UEFI, packing would only help saving RAM when there‘s actual padding (unlike this case, where there isn‘t). All architectures require natural data alignment („unless specifies otherwise“), so there should be no compatibility concerns for structures specific to UEFI and UEFI PI ever. When considering ABIs outside UEFI, even then natural alignment is the strictest realistically possible outside super niche platforms, as even executable formats don‘t pack their structures (this structure also is inherently naturally aligned).

Best regards,
Marvin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99968): https://edk2.groups.io/g/devel/message/99968
Mute This Topic: https://groups.io/mt/96871372/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230210/3eaf6968/attachment.htm>


More information about the edk2-devel-archive mailing list