mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Potentially infinite and deleted loops found by PVS-Studio (#7100)
- Fixed V712 - The compiler can optimize this code by creating an infinite loop, or simply deleting it. - There is need to add a volatile qualifier to the '_ExitFlag' and 'sim_delay' variables.
This commit is contained in:
parent
545458a687
commit
5012dffeae
@ -55,7 +55,7 @@ using namespace device;
|
||||
pthread_mutex_t filemutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
px4_sem_t lockstep_sem;
|
||||
bool sim_lockstep = false;
|
||||
bool sim_delay = false;
|
||||
volatile bool sim_delay = false;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ const unsigned path_max_len = PATH_MAX;
|
||||
const unsigned path_max_len = 1024;
|
||||
#endif
|
||||
|
||||
static bool _ExitFlag = false;
|
||||
static volatile bool _ExitFlag = false;
|
||||
|
||||
static struct termios orig_term;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user