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]

Re: [PATCH v2] Fix PR gdb/18653: gdb disturbs inferior's inherited signal dispositions


Pedro Alves <palves@redhat.com> writes:

> +      else
> +	{
> +	  int m;
> +
> +	  fprintf (out, "sigaction={sa_handler=", i);

The redundant "i" causes a compilation warning,

gdb/testsuite/gdb.base/signals-state-child.c:77:4: warning: too many arguments for format [-Wformat-extra-args]
    fprintf (out, "sigaction={sa_handler=", i);
    ^

The patch blow fixes this.  With this patch applied, the test case can
be compiled successfully.  However test fails,

shell diff -s /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/standalone.txt /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.base/signals-state-child/gdb.txt^M
13c13^M
< signal 13: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
---^M
> signal 13: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
25c25^M
< signal 25: sigaction={sa_handler=SIG_DFL, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
---^M
> signal 25: sigaction={sa_handler=SIG_IGN, sa_mask=0000000000000000000000000000000000000000000000000000000000000000, sa_flags=0}, masked=0^M
(gdb) FAIL: gdb.base/signals-state-child.exp: signals states are identical

-- 
Yao (齐尧)
From e1a1f81d96575dfda32022c599652cefae762798 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Fri, 12 Aug 2016 09:08:44 +0100
Subject: [PATCH] Fix warning in gdb.base/signals-state-child.c

I see the following warning when running signals-state-child.exp.

gdb/testsuite/gdb.base/signals-state-child.c:77:4: warning: too many arguments for format [-Wformat-extra-args]
    fprintf (out, "sigaction={sa_handler=", i);
    ^

this patch is to remove the argument from fprintf.

gdb/testsuite:

2016-08-12  Yao Qi  <yao.qi@linaro.org>

	* gdb.base/signals-state-child.c (main): Remove "i" from fprintf's
	argument list.

diff --git a/gdb/testsuite/gdb.base/signals-state-child.c b/gdb/testsuite/gdb.base/signals-state-child.c
index e11fa93..f934c86 100644
--- a/gdb/testsuite/gdb.base/signals-state-child.c
+++ b/gdb/testsuite/gdb.base/signals-state-child.c
@@ -74,7 +74,7 @@ main (int argc, char **argv)
 	{
 	  int m;
 
-	  fprintf (out, "sigaction={sa_handler=", i);
+	  fprintf (out, "sigaction={sa_handler=");
 
 	  if (oldact.sa_handler == SIG_DFL)
 	    fprintf (out, "SIG_DFL");


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