mirror of https://github.com/ArduPilot/ardupilot
AP_Scripting: avoid a error in lua with gcc 10.2 on STM32 with -Werror
This commit is contained in:
parent
67ebee599e
commit
9328fae953
|
@ -139,7 +139,12 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) {
|
||||||
ts = gco2ts(o);
|
ts = gco2ts(o);
|
||||||
ts->hash = h;
|
ts->hash = h;
|
||||||
ts->extra = 0;
|
ts->extra = 0;
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 10
|
||||||
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
|
#endif
|
||||||
getstr(ts)[l] = '\0'; /* ending 0 */
|
getstr(ts)[l] = '\0'; /* ending 0 */
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue