mirror of https://github.com/ArduPilot/ardupilot
AP_GPS: suppress string truncation warnings
This commit is contained in:
parent
898187950e
commit
b0c006deca
|
@ -727,6 +727,10 @@ void AP_GPS_NMEA::parse_versiona_field(uint16_t term_number, const char *term)
|
|||
// printf useful for debugging
|
||||
// ::printf("VERSIONA[%u]='%s'\n", term_number, term);
|
||||
auto &v = _versiona;
|
||||
#pragma GCC diagnostic push
|
||||
#if defined(__GNUC__) && __GNUC__ >= 10
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
#endif
|
||||
switch (term_number) {
|
||||
case 10:
|
||||
strncpy(v.type, _term, sizeof(v.type)-1);
|
||||
|
@ -738,6 +742,7 @@ void AP_GPS_NMEA::parse_versiona_field(uint16_t term_number, const char *term)
|
|||
strncpy(v.build_date, _term, sizeof(v.build_date)-1);
|
||||
break;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
#endif // AP_GPS_NMEA_UNICORE_ENABLED
|
||||
|
||||
|
|
Loading…
Reference in New Issue