Skip to content
Snippets Groups Projects
Commit 5012dffe authored by Phillip Khandeliants's avatar Phillip Khandeliants Committed by Daniel Agar
Browse files

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.
parent 545458a6
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment