This is the mail archive of the gdb-cvs@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]

[binutils-gdb] gdb.base/fileio.exp: Remove nowarnings


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d2a03b77450dce58f6b4f9f7fdd3c346a555bcf7

commit d2a03b77450dce58f6b4f9f7fdd3c346a555bcf7
Author: Pedro Alves <palves@redhat.com>
Date:   Thu May 18 11:47:05 2017 +0100

    gdb.base/fileio.exp: Remove nowarnings
    
    ... 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.

Diff:
---
 gdb/testsuite/ChangeLog           | 6 ++++++
 gdb/testsuite/gdb.base/fileio.c   | 6 +++++-
 gdb/testsuite/gdb.base/fileio.exp | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 6f877da..2ebddca 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2017-05-17  Yao Qi  <yao.qi@linaro.org>
 
 	* gdb.base/fileio.exp: Pass nowarnings to gdb_compile.
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
 }


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