From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] gdb.base/fileio.exp: Remove nowarnings
Date: Thu, 18 May 2017 11:09:00 -0000 [thread overview]
Message-ID: <1495105747-21675-1-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <9eedfbd7-9f36-2fe4-7a13-00e0b2261629@redhat.com>
... and quiet -Wnonnull in a different way.
gdb/testsuite/ChangeLog:
2017-05-18 Pedro Alves <palves@redhat.com>
* gdb.base/fileio.c (null_str): New global.
(test_stat): Use it.
* gdb.base/fileio.exp: Remove nowarnings.
---
gdb/testsuite/gdb.base/fileio.c | 6 +++++-
gdb/testsuite/gdb.base/fileio.exp | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
index e443173..38537db 100644
--- a/gdb/testsuite/gdb.base/fileio.c
+++ b/gdb/testsuite/gdb.base/fileio.c
@@ -76,6 +76,10 @@ static const char *strerrno (int err);
static void stop () {}
+/* A NULL string. We pass this to stat below instead of a NULL
+ literal to avoid -Wnonnull warnings. */
+const char *null_str;
+
int
test_open ()
{
@@ -294,7 +298,7 @@ test_stat ()
stop ();
/* NULL pathname */
errno = 0;
- ret = stat (NULL, &st);
+ ret = stat (null_str, &st);
printf ("stat 2: ret = %d, errno = %d %s\n", ret, errno,
strerrno (errno));
stop ();
diff --git a/gdb/testsuite/gdb.base/fileio.exp b/gdb/testsuite/gdb.base/fileio.exp
index 14aaa0d..6bb7141 100644
--- a/gdb/testsuite/gdb.base/fileio.exp
+++ b/gdb/testsuite/gdb.base/fileio.exp
@@ -31,7 +31,7 @@ if {[is_remote host]} {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
executable \
- [list debug nowarnings "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
+ [list debug "additional_flags=-DOUTDIR=\"$outdir/\""]] != "" } {
untested "failed to compile"
return -1
}
--
2.5.5
next prev parent reply other threads:[~2017-05-18 11:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 13:46 [PATCH OBV] Add nowarnings in gdb.base/fileio.exp Yao Qi
2017-05-17 14:17 ` Pedro Alves
2017-05-18 8:34 ` Yao Qi
2017-05-18 11:06 ` Pedro Alves
2017-05-18 11:09 ` [PATCH 2/3] gdb.base/fileio.c: Fix several -Wreturn-type warnings Pedro Alves
2017-05-18 11:09 ` Pedro Alves [this message]
2017-05-18 11:09 ` [PATCH 3/3] gdb.base/fileio.c: Fix several -Wmaybe-uninitialized warnings Pedro Alves
2017-05-18 11:30 ` [PATCH OBV] Add nowarnings in gdb.base/fileio.exp Yao Qi
2017-05-18 11:51 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1495105747-21675-1-git-send-email-palves@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox