Commit 2f5f31bb authored by Daniel Gustafsson's avatar Daniel Gustafsson
Browse files

tool_cb_wrt: Silence function cast compiler warning

Commit 5bfaa86c

 introduced a new
compiler warning on Windows cross compilation with GCC. See below
for an example of the warning from the autobuild logs (whitespace
edited to fit):

/src/tool_cb_wrt.c:175:9: warning: cast from function call of type
    'intptr_t {aka long long int}' to non-matching type 'void *'
(HANDLE) _get_osfhandle(fileno(outs->stream)),

Store the return value from _get_osfhandle() in an intermediate
variable and cast the variable in WriteConsoleW() rather than the
function call directly to avoid a compiler warning.

In passing, also add inspection of the MultiByteToWideChar() return
value and return failure in case an error is reported.

Closes #3263
Reviewed-by: default avatarMarcel Raad <>
Reviewed-by: default avatarViktor Szakats <>
parent 42fd2350
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment