Fix unused return result hack to work on macOS/GCC 7.4+

As of GCC 7.4 (at least under macOS 10.10), the previous workaround of
casting a must-use result to `(void)` to avoid warnings about unused
code no longer works.

This workaround is uglier but it quiets these warnings.
This commit is contained in:
Mahmoud Al-Qudsi 2019-12-18 12:43:13 -06:00
parent 60670999ad
commit 92401d8ebb

View file

@ -154,7 +154,8 @@ generation_list_t topic_monitor_t::await_gens(const generation_list_t &input_gen
(void)select(fd + 1, &fds, nullptr, nullptr, nullptr /* timeout */);
#endif
uint8_t ignored[PIPE_BUF];
(void)read(fd, ignored, sizeof ignored);
auto unused = read(fd, ignored, sizeof ignored);
if (unused) {}
// We are finished reading. We must stop being the reader, and post on the condition
// variable to wake up any other threads waiting for us to finish reading.