This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] gdbserver: var iable might be clobbered by ‘longjm p’


Hi,

gcc -flto with gcc-4.7.0-5.fc17.x86_64 produces
server.c: In function ‘main’:
server.c:2607:7: error: variable ‘multi_mode’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
server.c:2608:7: error: variable ‘attach’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]

probably obvious, I will check it in.


Thanks,
Jan


gdb/gdbserver/
2012-05-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix gcc -flto compilation warning.
	* server.c (main): Make variable multi_mode and attach volatile.

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 30bb3c3..9fd550b 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2604,8 +2604,8 @@ main (int argc, char *argv[])
   int pid;
   char *arg_end, *port;
   char **next_arg = &argv[1];
-  int multi_mode = 0;
-  int attach = 0;
+  volatile int multi_mode = 0;
+  volatile int attach = 0;
   int was_running;
 
   while (*next_arg != NULL && **next_arg == '-')


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]