diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index 42e47470ce..a8b683ad4f 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -3018,8 +3018,8 @@ bool AP_Param::add_param(uint8_t _key, uint8_t param_num, const char *pname, flo } // check CRC - auto &hinfo = const_cast(info.group_info)[0]; - const auto crc = to_int32(hinfo.def_value); + const auto &hinfo = const_cast(info.group_info)[0]; + const int32_t crc = to_int32(hinfo.def_value); int32_t current_crc; if (load_int32(key, 0, current_crc) && current_crc != crc) {