• Kenton Varda's avatar
    GCC doesn't accept (void) to silence warn_unused_result. · f6df70e5
    Kenton Varda authored
    This is stupid, but the GCC maintainers refused to change it:
    
        https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
    
    For some reason, KJ's uses of (void) did not warn with GCC 5 but do warn with GCC 7. Supposedly, GCC *never* supported silencing with (void), so there must have been some other bug that caused GCC to fail to trigger the warning previously -- maybe related to the fact that the values being returned are non-trivial types?
    
    C++17 introduces `[[nodiscard]]` which is defined as being squelchable using `(void)`, but we're still on C++14, and KJ_UNUSED_RESULT is a post-declaration attribute so can't be defined in terms of the new C++17 attribute even if the compiler supports it. Sigh.
    f6df70e5
Name
Last commit
Last update
..
benchmark Loading commit data...
capnp Loading commit data...
kj Loading commit data...
CMakeLists.txt Loading commit data...