[PATCH] Fix windows-nat.c for -Wnarrowing

Tom Tromey tom@tromey.com
Wed Aug 29 19:22:00 GMT 2018


>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

Eli> Why did you need to make .them be DWORD?  I think it should be a
Eli> 'long', and then you can use -1L without any trouble.

Thanks for the suggestion.  I tried this just now but long doesn't work
without additional casts:

../../binutils-gdb/gdb/windows-nat.c:304:1: error: narrowing conversion of '3221225477' from 'DWORD {aka long unsigned int}' to 'long int' inside { } [-Wnarrowing]
 };
 ^
../../binutils-gdb/gdb/windows-nat.c:304:1: error: narrowing conversion of '3221225725' from 'DWORD {aka long unsigned int}' to 'long int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:304:1: error: narrowing conversion of '2147483651' from 'DWORD {aka long unsigned int}' to 'long int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:304:1: error: narrowing conversion of '2147483652' from 'DWORD {aka long unsigned int}' to 'long int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:304:1: error: narrowing conversion of '3221225614' from 'DWORD {aka long unsigned int}' to 'long int' inside { } [-Wnarrowing]

Tom



More information about the Gdb-patches mailing list