]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb.base/fileio.exp: Remove nowarnings
authorPedro Alves <palves@redhat.com>
Thu, 18 May 2017 10:47:05 +0000 (11:47 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 18 May 2017 10:47:05 +0000 (11:47 +0100)
... 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/ChangeLog
gdb/testsuite/gdb.base/fileio.c
gdb/testsuite/gdb.base/fileio.exp

index 6f877daeae1c2ca1f5819f48694d72ff3d422ec3..2ebddca95c30de40b6fc77db7a37f9c78c1c377f 100644 (file)
@@ -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.
index e44317344a2bffa82b5fbf3e5d969a72f3a55824..38537db69ba54e96772db8f77b0e9069b08bd83e 100644 (file)
@@ -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 ();
index 14aaa0d36ab397e56e36cb066ef7a2dce31aedda..6bb71415d17cf4b80115a717b2356800c86448e6 100644 (file)
@@ -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
 }