fix: make UNREACHABLE() macro safe on compilers lacking __builtin_unreachable
Add fallback empty UNREACHABLE() definition for GCC < 4.5 and non-MSVC compilers, and insert return/break statements after all UNREACHABLE() calls to prevent -Wreturn-type warnings when the macro expands to nothing. Also cast malloc result to char* in io.c to suppress C++ compilation warning.
This commit is contained in:
+1
-1
@@ -212,7 +212,7 @@ static void allocCallback(uv_handle_t* handle, size_t suggestedSize,
|
||||
uv_buf_t* buf)
|
||||
{
|
||||
// TODO: Handle allocation failure.
|
||||
buf->base = malloc(suggestedSize);
|
||||
buf->base = (char*)malloc(suggestedSize);
|
||||
buf->len = suggestedSize;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user