From 741abaf7606ba88a5d1d8e05f085ad77fda548e3 Mon Sep 17 00:00:00 2001 From: Nick Exton Date: Mon, 2 Mar 2020 15:56:27 +1100 Subject: [PATCH] AP_Param: Add static assert on NVM struct sizes --- libraries/AP_Param/AP_Param.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_Param/AP_Param.h b/libraries/AP_Param/AP_Param.h index a58c7c561e..a39543e463 100644 --- a/libraries/AP_Param/AP_Param.h +++ b/libraries/AP_Param/AP_Param.h @@ -518,6 +518,7 @@ private: uint8_t revision; uint8_t spare; }; + static_assert(sizeof(struct EEPROM_header) == 4, "Bad EEPROM_header size!"); static uint16_t sentinal_offset; @@ -540,6 +541,7 @@ private: uint32_t key_high : 1; uint32_t group_element : 18; }; + static_assert(sizeof(struct Param_header) == 4, "Bad Param_header size!"); // number of bits in each level of nesting of groups static const uint8_t _group_level_shift = 6;