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:
Edward Welbourne 2023-01-23 11:38:55 +01:00
parent 372dc4c6a1
commit 7d45117571
3 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ using namespace QtIpcCommon;
bool QSharedMemoryPosix::runtimeSupportCheck()
{
static const bool result = []() {
shm_open("", 0, 0); // this WILL fail
(void)shm_open("", 0, 0); // this WILL fail
return errno != ENOSYS;
}();
return result;

View File

@ -36,7 +36,7 @@ bool QSharedMemorySystemV::runtimeSupportCheck()
return false;
#endif
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 result;

View File

@ -40,7 +40,7 @@ bool QSystemSemaphoreSystemV::runtimeSupportCheck()
return false;
#endif
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 result;