Prefer abort over assert(false)

The compiler can remove the latter when compiled with NDEBUG which may
cause unintended control flow.
This commit is contained in:
Andrew Gaul
2019-01-20 12:29:38 -08:00
parent c83a3e67c9
commit 40ba3b44a1
4 changed files with 8 additions and 10 deletions

View File

@ -30,7 +30,6 @@
#include <syslog.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <dirent.h>
#include <curl/curl.h>
#include <string>
@ -2000,7 +1999,7 @@ FdManager::FdManager()
S3FS_PRN_CRIT("failed to init mutex");
}
}else{
assert(false);
abort();
}
}
@ -2024,7 +2023,7 @@ FdManager::~FdManager()
FdManager::is_lock_init = false;
}
}else{
assert(false);
abort();
}
}