Cast away [[nodiscard]] values in runtime support checks
Test calls in Q{SystemSemaphore,SharedMemory}*::runtimeSupportCheck() are commented to be sure to fail, so the return is irrelevant. Suppresses warnings from CodeChecker. Change-Id: I2ac6ccb8d96a169229dcf24a744015fb9d414c74 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
372dc4c6a1
commit
7d45117571
@ -27,7 +27,7 @@ using namespace QtIpcCommon;
|
|||||||
bool QSharedMemoryPosix::runtimeSupportCheck()
|
bool QSharedMemoryPosix::runtimeSupportCheck()
|
||||||
{
|
{
|
||||||
static const bool result = []() {
|
static const bool result = []() {
|
||||||
shm_open("", 0, 0); // this WILL fail
|
(void)shm_open("", 0, 0); // this WILL fail
|
||||||
return errno != ENOSYS;
|
return errno != ENOSYS;
|
||||||
}();
|
}();
|
||||||
return result;
|
return result;
|
||||||
|
@ -36,7 +36,7 @@ bool QSharedMemorySystemV::runtimeSupportCheck()
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
static const bool result = []() {
|
static const bool result = []() {
|
||||||
shmget(IPC_PRIVATE, ~size_t(0), 0); // this will fail
|
(void)shmget(IPC_PRIVATE, ~size_t(0), 0); // this will fail
|
||||||
return errno != ENOSYS;
|
return errno != ENOSYS;
|
||||||
}();
|
}();
|
||||||
return result;
|
return result;
|
||||||
|
@ -40,7 +40,7 @@ bool QSystemSemaphoreSystemV::runtimeSupportCheck()
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
static const bool result = []() {
|
static const bool result = []() {
|
||||||
semget(IPC_PRIVATE, -1, 0); // this will fail
|
(void)semget(IPC_PRIVATE, -1, 0); // this will fail
|
||||||
return errno != ENOSYS;
|
return errno != ENOSYS;
|
||||||
}();
|
}();
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user