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.c: Fix several -Wmaybe-uninitialized warnings


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

commit 59cc050d893d1e8c75547de950a35e809588f12f
Author: Pedro Alves <palves@redhat.com>
Date:   Thu May 18 11:40:08 2017 +0100

    gdb.base/fileio.c: Fix several -Wmaybe-uninitialized warnings
    
     src/gdb/testsuite/gdb.base/fileio.c: In function â??test_writeâ??:
     src/gdb/testsuite/gdb.base/fileio.c:158:5: warning: â??retâ?? may be used uninitialized in this function [-Wmaybe-uninitialized]
          printf ("write 1: ret = %d, errno = %d\n", ret, errno);
          ^
    
    gdb/ChangeLog:
    2017-05-18  Pedro Alves  <palves@redhat.com>
    
    	* gdb.base/fileio.c (test_write, test_read, test_close)
    	(test_fstat): Don't print 'ret' in the fail path.

Diff:
---
 gdb/testsuite/ChangeLog         |  5 +++++
 gdb/testsuite/gdb.base/fileio.c | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 428056e..c127f1a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
 2017-05-18  Pedro Alves  <palves@redhat.com>
 
+	* gdb.base/fileio.c (test_write, test_read, test_close)
+	(test_fstat): Don't print 'ret' in the fail path.
+
+2017-05-18  Pedro Alves  <palves@redhat.com>
+
 	* gdb.base/fileio.c (stop, test_open, test_write, test_read)
 	(test_lseek, test_close, test_stat, test_fstat, test_isatty)
 	(test_system, test_rename, test_unlink, test_time): Change
diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c
index 415f2d0..7f482a3 100644
--- a/gdb/testsuite/gdb.base/fileio.c
+++ b/gdb/testsuite/gdb.base/fileio.c
@@ -157,7 +157,7 @@ test_write (void)
       close (fd);
     }
   else
-    printf ("write 1: ret = %d, errno = %d\n", ret, errno);
+    printf ("write 1: errno = %d\n", errno);
   stop ();
   /* Write using invalid file descriptor */
   errno = 0;
@@ -177,7 +177,7 @@ test_write (void)
       close (fd);
     }
   else
-    printf ("write 3: ret = %d, errno = %d\n", ret, errno);
+    printf ("write 3: errno = %d\n", errno);
   stop ();
 }
 
@@ -203,7 +203,7 @@ test_read (void)
       close (fd);
     }
   else
-    printf ("read 1: ret = %d, errno = %d\n", ret, errno);
+    printf ("read 1: errno = %d\n", errno);
   stop ();
   /* Read using invalid file descriptor */
   errno = 0;
@@ -271,7 +271,7 @@ test_close (void)
               ret == 0 ? "OK" : "");
     }
   else
-    printf ("close 1: ret = %d, errno = %d\n", ret, errno);
+    printf ("close 1: errno = %d\n", errno);
   stop ();
   /* Close an invalid file descriptor */
   errno = 0;
@@ -337,7 +337,7 @@ test_fstat (void)
       close (fd);
     }
   else
-    printf ("fstat 1: ret = %d, errno = %d\n", ret, errno);
+    printf ("fstat 1: errno = %d\n", errno);
   stop ();
   /* Fstat using invalid file descriptor */
   errno = 0;


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