diff options
author | Tom Tromey <tom@tromey.com> | 2018-08-29 11:37:42 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-08-29 14:24:54 -0600 |
commit | 73c13fe69a4275433544533a610275861346ef44 (patch) | |
tree | 838461f2b289c93c5f4cc6cb1de16a790c9dd01b /gdb/compile/compile-cplus-symbols.c | |
parent | df28970fcc741fa744a51aece29bb755c20eceab (diff) | |
download | gdb-73c13fe69a4275433544533a610275861346ef44.zip gdb-73c13fe69a4275433544533a610275861346ef44.tar.gz gdb-73c13fe69a4275433544533a610275861346ef44.tar.bz2 |
Fix windows-nat.c for -Wnarrowing
Sergio pointed out that the Windows builder was failing due to the
-Wnarrowing patch, with:
../../binutils-gdb/gdb/windows-nat.c:301:27: error: narrowing conversion of '3221225477' from 'DWORD {aka long unsigned int}' to 'int' inside { } [-Wnarrowing]
{-1, GDB_SIGNAL_UNKNOWN}};
^
../../binutils-gdb/gdb/windows-nat.c:301:27: error: narrowing conversion of '3221225725' from 'DWORD {aka long unsigned int}' to 'int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:301:27: error: narrowing conversion of '2147483651' from 'DWORD {aka long unsigned int}' to 'int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:301:27: error: narrowing conversion of '2147483652' from 'DWORD {aka long unsigned int}' to 'int' inside { } [-Wnarrowing]
../../binutils-gdb/gdb/windows-nat.c:301:27: error: narrowing conversion of '3221225614' from 'DWORD {aka long unsigned int}' to 'int' inside { } [-Wnarrowing]
Looking into this, I found two things.
First, in struct xlate_exception, it is better to have "them" be of
type DWORD, as that's the type actually in use.
Second, struct xlate_exception and xlate are not used in this file,
because the code in windows_nat_target::resume is #if'd out.
This patch changes the type of "them", but also similarly #if's out
this object.
In order to avoid a narrowing warning from the -1 entry, at Pedro's
suggestion I have removed this and changed windows_nat_target::resume
to use ranged for.
Tested by rebuilding using the mingw toolchain on x86-64 Fedora 28. I
also tested it by temporarily removing the "#if 0"s and rebuilding.
gdb/ChangeLog
2018-08-29 Tom Tromey <tom@tromey.com>
* windows-nat.c (struct xlate_exception) <them>: Change type to
DWORD.
(xlate): Fix formatting. Remove last entry.
(struct xlate_exception, xlate): Comment out.
(windows_nat_target::resume): Use ranged for.
Diffstat (limited to 'gdb/compile/compile-cplus-symbols.c')
0 files changed, 0 insertions, 0 deletions