| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
On MSVC, ruby.h expands UNREACHABLE_RETURN(val) to
`return (__assume(0), (val))`, so calling it without an argument
produces an empty parenthesized expression and fails to compile:
packer.h(421): error C2059: syntax error: ')'
GCC and Clang happen to accept the empty argument, which is why this
only surfaced on mswin. rb_raise is declared NORETURN so the hint is
redundant; drop it along with the Ruby 2.5 fallback definition.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
This PR fixes a Windows (MSVC) build failure caused by calling Ruby’s UNREACHABLE_RETURN() macro with no argument in ext/msgpack/packer.h. Since the error path already uses rb_raise (declared NORETURN), the explicit “unreachable” return hint is unnecessary and is removed along with the now-unused Ruby 2.5 fallback macro.
Changes:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Installing msgpack 1.8.3 on the x64-mswin64_140 platform fails to compile with the following error.
On MSVC, ruby.h expands UNREACHABLE_RETURN(val) to return (__assume(0), (val)), so calling it without an argument produces an empty parenthesized expression that fails to parse. GCC and Clang happen to accept the empty argument, which is why this only surfaces on mswin. rb_raise is declared NORETURN so the unreachability hint is redundant. This removes the call along with the Ruby 2.5 fallback definition that existed only for it.
With this change the extension builds with MSVC 14.51 and the test suite passes on Windows with 455 examples and 0 failures.