fix compilation warning (enum out of range) in winedbg
vlad.bespalov at jetstreamsoft.com
vlad.bespalov at jetstreamsoft.com
Wed Jan 31 03:14:53 CST 2018
when compiled with clang the following warning message is produced:
../../../programs/winedbg/gdbproxy.c:1586:27: warning: comparison of
constant -1 with expression of type 'enum be_xpoint_type' is always
true [-Wtautological-constant-out-of-range-compare]
if (xpt->type != -1 && xpt_addr >= addr && xpt_addr <
addr + blk_len)
~~~~~~~~~ ^ ~~
../../../programs/winedbg/gdbproxy.c:2236:23: warning: comparison of
constant -1 with expression of type 'enum be_xpoint_type' is always
false [-Wtautological-constant-out-of-range-compare]
if (xpt->type == -1)
~~~~~~~~~ ^ ~~
2 warnings generated.
compiler is free to choose underlying type as long as all defined
enum entries fit into it, so as no negative values were defined,
it can be expected to use unsigned underlying type and drop the checks.
Proposed patch adds explicit enum member with value (-1) to make sure
underlying type would have this value allowed.
Thanks,
Vlad.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-compilation-warning.patch
Type: text/x-diff
Size: 2767 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20180131/96d30aa0/attachment.patch>
More information about the wine-patches
mailing list