diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-09 16:43:54 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-09 16:52:42 +0000 |
| commit | d3b567edcfc7c5c323609b19bd72eb38ea40c756 (patch) | |
| tree | bba456134ade3ac870f4df50c241bf4313526f03 /util/nvmutil | |
| parent | afebfe73898b1795f53ff819fdd793a4cb4be73a (diff) | |
util/nvmutil: assert uint16_t as 16-bits
some platforms might get this wrong. define it
explicitly.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 00683062..0553b196 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -38,6 +38,12 @@ #include <string.h> #include <unistd.h> +#if __STDC_VERSION__ >= 201112L +_Static_assert(sizeof(uint16_t) == 2, "uint16_t must be 16 bits"); +#else +typedef char static_assert_uint16_t_is_2[(sizeof(uint16_t) == 2) ? 1 : -1]; +#endif + /* * The BSD versions that could realistically build * nvmutil almost certainly have arc4random (first |
