diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-15 21:09:17 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-04-15 21:09:17 -0400 |
commit | e2275c6ee8caa98d6526422743a97d5dd5ac040d (patch) | |
tree | 5b7f1b4b2fe1dff2d63298537379db4591fdd7bc /gdbserver/win32-low.cc | |
parent | 27e91adae9f2f7903b704eea0894d4835432a397 (diff) | |
download | gdb-e2275c6ee8caa98d6526422743a97d5dd5ac040d.zip gdb-e2275c6ee8caa98d6526422743a97d5dd5ac040d.tar.gz gdb-e2275c6ee8caa98d6526422743a97d5dd5ac040d.tar.bz2 |
gdbserver: fix format string warning in win32-low.cc
When compiling on Cygwin, we get:
CXX win32-low.o
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘int get_child_debug_event(DWORD*, target_waitstatus*)’:
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1459:17: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long int’ [-Werror=format=]
1459 | OUTMSG2 (("get_windows_debug_event - "
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1460 | "unexpected stop in 0x%x (expecting 0x%x)\n",
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1461 | ptid.lwp (), desired_stop_thread_id));
| ~~~~~~~~~~~
| |
| long int
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:52:11: note: in definition of macro ‘OUTMSG2’
52 | printf X; \
| ^
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1460:26: note: format string is defined here
1460 | "unexpected stop in 0x%x (expecting 0x%x)\n",
| ~^
| |
| unsigned int
| %lx
`ptid.lwp ()` is a `long` value, so it indeed needs the `l` size modifier.
gdbserver/ChangeLog:
* win32-low.cc (get_child_debug_event): Fix format string warning.
Diffstat (limited to 'gdbserver/win32-low.cc')
-rw-r--r-- | gdbserver/win32-low.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index e1226b4..75305a4 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -1457,7 +1457,7 @@ get_child_debug_event (DWORD *continue_status, /* Pending stop. See the comment by the definition of "pending_stops" for details on why this is needed. */ OUTMSG2 (("get_windows_debug_event - " - "unexpected stop in 0x%x (expecting 0x%x)\n", + "unexpected stop in 0x%lx (expecting 0x%x)\n", ptid.lwp (), desired_stop_thread_id)); maybe_adjust_pc (); pending_stops.push_back ({(DWORD) ptid.lwp (), *ourstatus, current_event}); |