* [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/
@ 2015-12-10 16:31 Pedro Alves
2016-01-08 18:55 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/] Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2015-12-10 16:31 UTC (permalink / raw)
To: gdb-patches
Several of the gdb.multi tests use the "nowarnings" option to suppress
warnings. The warnings in question all come from missing headers,
like e.g.:
src/gdb/testsuite/gdb.multi/multi-arch-exec.c:28:3: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default]
exit (1);
^
There's no point in trying to avoid to include standard headers. In
gdb.base/hangout.c's case, it's even dangerous, as that file calls
printf. In order to compile a call to a variatic function correctly,
a declaration must be visible.
gdb/testsuite/ChangeLog:
2015-12-10 Pedro Alves <palves@redhat.com>
* gdb.multi/base.exp: Don't use nowarnings.
* gdb.multi/bkpt-multi-exec.exp: Don't use nowarnings.
* gdb.multi/hangout.c: Include stdio.h.
* gdb.multi/hello.c: Include stdlib.h.
* gdb.multi/multi-arch-exec.c: Include stdlib.h.
* gdb.multi/multi-arch-exec.exp: Don't use nowarnings.
* gdb.multi/multi-arch.exp: Don't use nowarnings.
---
gdb/testsuite/ChangeLog | 10 ++++++++++
gdb/testsuite/gdb.multi/base.exp | 6 +++---
gdb/testsuite/gdb.multi/bkpt-multi-exec.exp | 2 +-
gdb/testsuite/gdb.multi/hangout.c | 2 ++
gdb/testsuite/gdb.multi/hello.c | 2 ++
gdb/testsuite/gdb.multi/multi-arch-exec.c | 1 +
gdb/testsuite/gdb.multi/multi-arch-exec.exp | 4 ++--
gdb/testsuite/gdb.multi/multi-arch.exp | 4 ++--
8 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index bad4382..f0e026d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2015-12-10 Pedro Alves <palves@redhat.com>
+
+ * gdb.multi/base.exp: Don't use nowarnings.
+ * gdb.multi/bkpt-multi-exec.exp: Don't use nowarnings.
+ * gdb.multi/hangout.c: Include stdio.h.
+ * gdb.multi/hello.c: Include stdlib.h.
+ * gdb.multi/multi-arch-exec.c: Include stdlib.h.
+ * gdb.multi/multi-arch-exec.exp: Don't use nowarnings.
+ * gdb.multi/multi-arch.exp: Don't use nowarnings.
+
2015-12-10 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.dwarf2/dw2-ranges-base.c: New file.
diff --git a/gdb/testsuite/gdb.multi/base.exp b/gdb/testsuite/gdb.multi/base.exp
index 78b913c..b58e49a 100644
--- a/gdb/testsuite/gdb.multi/base.exp
+++ b/gdb/testsuite/gdb.multi/base.exp
@@ -30,15 +30,15 @@ set exec3 "goodbye"
set srcfile3 ${exec3}.c
set binfile3 [standard_output_file ${exec3}]
-if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug nowarnings}] == -1 } {
+if { [build_executable ${testfile}.exp ${exec1} "${srcfile1}" {debug}] == -1 } {
return -1
}
-if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug nowarnings}] == -1} {
+if { [build_executable ${testfile}.exp ${exec2} "${srcfile2}" {debug}] == -1} {
return -1
}
-if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug nowarnings}] == -1 } {
+if { [build_executable ${testfile}.exp ${exec3} "${srcfile3}" {debug}] == -1 } {
return -1
}
diff --git a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
index 4f572bb..e66c1ba 100644
--- a/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
+++ b/gdb/testsuite/gdb.multi/bkpt-multi-exec.exp
@@ -33,7 +33,7 @@ set exec2 "crashme"
set srcfile2 ${exec2}.c
set binfile2 [standard_output_file ${exec2}]
-set compile_options {debug nowarnings}
+set compile_options {debug}
set dirname [relative_filename [pwd] [file dirname $binfile1]]
lappend compile_options "additional_flags=-DBASEDIR=\"$dirname\""
diff --git a/gdb/testsuite/gdb.multi/hangout.c b/gdb/testsuite/gdb.multi/hangout.c
index c67b621..0ac2650 100644
--- a/gdb/testsuite/gdb.multi/hangout.c
+++ b/gdb/testsuite/gdb.multi/hangout.c
@@ -15,6 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <stdio.h>
+
main(int argc, char *argv[])
{
int i;
diff --git a/gdb/testsuite/gdb.multi/hello.c b/gdb/testsuite/gdb.multi/hello.c
index 0233c96..a7c11f7 100644
--- a/gdb/testsuite/gdb.multi/hello.c
+++ b/gdb/testsuite/gdb.multi/hello.c
@@ -15,6 +15,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <stdlib.h>
+
short hglob = 1;
short glob = 92;
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.c b/gdb/testsuite/gdb.multi/multi-arch-exec.c
index 4c8dfaa..918af4b 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.c
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.c
@@ -15,6 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/gdb/testsuite/gdb.multi/multi-arch-exec.exp b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
index 67020d9..a54f408 100644
--- a/gdb/testsuite/gdb.multi/multi-arch-exec.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch-exec.exp
@@ -54,13 +54,13 @@ if [istarget "s390*-*-*"] {
set dirname [relative_filename [pwd] [file dirname $binfile2]]
if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
- [list debug nowarnings \
+ [list debug \
additional_flags=${march1} \
additional_flags=-DBASEDIR=\"$dirname\"]] } {
return -1
}
-set options [list debug nowarnings]
+set options [list debug]
if { [istarget "aarch64*-*-*"] } {
if {[info exists ARM_CC_FOR_TARGET]} {
diff --git a/gdb/testsuite/gdb.multi/multi-arch.exp b/gdb/testsuite/gdb.multi/multi-arch.exp
index 70d0a09..986e663 100644
--- a/gdb/testsuite/gdb.multi/multi-arch.exp
+++ b/gdb/testsuite/gdb.multi/multi-arch.exp
@@ -53,11 +53,11 @@ if [istarget "s390*-*-*"] {
}
if { [prepare_for_testing ${testfile}.exp ${exec1} "${srcfile1}" \
- [list debug nowarnings additional_flags=${march1}]] } {
+ [list debug additional_flags=${march1}]] } {
return -1
}
-set options [list debug nowarnings]
+set options [list debug]
if [istarget "aarch64*-*-*"] {
if {[info exists ARM_CC_FOR_TARGET]} {
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [testsuite patch] Fix gdb.multi/base.exp testsuite regression [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/]
2015-12-10 16:31 [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/ Pedro Alves
@ 2016-01-08 18:55 ` Jan Kratochvil
2016-01-08 19:04 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2016-01-08 18:55 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
On Thu, 10 Dec 2015 17:31:11 +0100, Pedro Alves wrote:
> Several of the gdb.multi tests use the "nowarnings" option to suppress
> warnings.
commit 762f774785f4ef878ac4c831e1f4733dc957234d
Author: Pedro Alves <palves@redhat.com>
Date: Thu Dec 10 16:21:06 2015 +0000
Stop using nowarnings in gdb/testsuite/gdb.multi/
+gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun':
+gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration]
+ int commonfun() { bar(); } /* from hello */
+ ^
+gdb/testsuite/gdb.multi/hello.c: At top level:
+gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ bar()
+ ^
+gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ hello(int x)
+ ^
+gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ main()
+ ^
+UNTESTED: gdb.multi/base.exp: base.exp
OK for check-in?
Jan
[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 1672 bytes --]
gdb/testsuite/ChangeLog
2016-01-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.multi/goodbye.c: Fix compilation warnings by adding return types
and reordering the functions.
* gdb.multi/hangout.c: Likewise.
* gdb.multi/hello.c: Likewise.
diff --git a/gdb/testsuite/gdb.multi/goodbye.c b/gdb/testsuite/gdb.multi/goodbye.c
index 701e504..bf7759a 100644
--- a/gdb/testsuite/gdb.multi/goodbye.c
+++ b/gdb/testsuite/gdb.multi/goodbye.c
@@ -39,24 +39,28 @@ int verylongfun()
glob *= 9;
}
-main() {
- mailand();
- foo(glob);
- verylongfun();
- goodbye();
-}
-
-foo(int x) {
- return x + 92;
-}
-
+void
mailand()
{
glob = 46;
}
-void commonfun() { mailand(); } /* from goodbye */
+int
+foo(int x) {
+ return x + 92;
+}
+void
goodbye() {
++glob;
}
+
+int
+main() {
+ mailand();
+ foo(glob);
+ verylongfun();
+ goodbye();
+}
+
+void commonfun() { mailand(); } /* from goodbye */
diff --git a/gdb/testsuite/gdb.multi/hangout.c b/gdb/testsuite/gdb.multi/hangout.c
index e2c41b8..3701512 100644
--- a/gdb/testsuite/gdb.multi/hangout.c
+++ b/gdb/testsuite/gdb.multi/hangout.c
@@ -17,6 +17,7 @@
#include <stdio.h>
+int
main(int argc, char *argv[])
{
int i;
diff --git a/gdb/testsuite/gdb.multi/hello.c b/gdb/testsuite/gdb.multi/hello.c
index efff59d..93d921f 100644
--- a/gdb/testsuite/gdb.multi/hello.c
+++ b/gdb/testsuite/gdb.multi/hello.c
@@ -21,20 +21,23 @@ short hglob = 1;
short glob = 92;
-int commonfun() { bar(); } /* from hello */
-
+void
bar()
{
if (glob == 0)
exit(1);
}
+int commonfun() { bar(); } /* from hello */
+
+int
hello(int x)
{
x *= 2;
return x + 45;
}
+int
main()
{
int tmpx;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [testsuite patch] Fix gdb.multi/base.exp testsuite regression
2016-01-08 18:55 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/] Jan Kratochvil
@ 2016-01-08 19:04 ` Pedro Alves
2016-01-08 19:08 ` [commit] " Jan Kratochvil
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2016-01-08 19:04 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On 01/08/2016 06:55 PM, Jan Kratochvil wrote:
> On Thu, 10 Dec 2015 17:31:11 +0100, Pedro Alves wrote:
>> Several of the gdb.multi tests use the "nowarnings" option to suppress
>> warnings.
>
> commit 762f774785f4ef878ac4c831e1f4733dc957234d
> Author: Pedro Alves <palves@redhat.com>
> Date: Thu Dec 10 16:21:06 2015 +0000
> Stop using nowarnings in gdb/testsuite/gdb.multi/
>
> +gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun':
> +gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration]
> + int commonfun() { bar(); } /* from hello */
> + ^
> +gdb/testsuite/gdb.multi/hello.c: At top level:
> +gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int]
> + bar()
> + ^
> +gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int]
> + hello(int x)
> + ^
> +gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int]
> + main()
> + ^
> +UNTESTED: gdb.multi/base.exp: base.exp
>
>
> OK for check-in?
OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 4+ messages in thread
* [commit] [testsuite patch] Fix gdb.multi/base.exp testsuite regression
2016-01-08 19:04 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression Pedro Alves
@ 2016-01-08 19:08 ` Jan Kratochvil
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kratochvil @ 2016-01-08 19:08 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb-patches
On Fri, 08 Jan 2016 20:04:13 +0100, Pedro Alves wrote:
> OK.
Checked in:
6cfc1fcb515d1ecd8445905b4749b81b3ca69552
Thanks,
Jan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-01-08 19:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 16:31 [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/ Pedro Alves
2016-01-08 18:55 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression [Re: [ob/pushed] Stop using nowarnings in gdb/testsuite/gdb.multi/] Jan Kratochvil
2016-01-08 19:04 ` [testsuite patch] Fix gdb.multi/base.exp testsuite regression Pedro Alves
2016-01-08 19:08 ` [commit] " Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).