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

[RFA] fix some problems in testsuite


  While trying to test the release candidate
on a ubuntu server i386-pc-linux
a got several UNTESTED related to warnings
issued by gcc.
  It seems that the installed version of gcc 
does generate warnings for format by default.

See
http://sourceware.org/ml/gdb/2009-10/msg00014.html

This patch handles 1),2) and 6)
problems in that email.

Tested on compile farm gcc16,
no changes there... (that gcc seems less picky).

Is this OK?

Pierre Muller
Pascal language support maintainer for GDB





gdb/testsuite ChangeLog entry:

2009-10-01  Pierre Muller  <muller@ics.u-strasbg.fr>

	* gdb.base/fileio.c (test_lseek): typecast off_t ret variable to
	long type.
	(test_unlink): Correct printf string.
	* gdb.base/checkpoint.c (main): Correct fprintf string for variable
i.
	* gdb.threads/attachstop-mt.c: Add #include <string.h>.


Index: src/gdb/testsuite/gdb.base/fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/fileio.c,v
retrieving revision 1.10
diff -u -p -r1.10 fileio.c
--- src/gdb/testsuite/gdb.base/fileio.c	13 Jun 2006 08:55:22 -0000	1.10
+++ src/gdb/testsuite/gdb.base/fileio.c	1 Oct 2009 11:37:07 -0000
@@ -231,13 +231,13 @@ test_lseek ()
     }
   else
     {
-      printf ("lseek 1: ret = %d, errno = %d %s\n", ret, errno,
+      printf ("lseek 1: ret = %ld, errno = %d %s\n", (long) ret, errno,
 	      strerrno (errno));
       stop ();
-      printf ("lseek 2: ret = %d, errno = %d %s\n", ret, errno,
+      printf ("lseek 2: ret = %ld, errno = %d %s\n", (long) ret, errno,
 	      strerrno (errno));
       stop ();
-      printf ("lseek 3: ret = %d, errno = %d %s\n", ret, errno,
+      printf ("lseek 3: ret = %ld, errno = %d %s\n", (long) ret, errno,
 	      strerrno (errno));
     }
   /* Seeking on an invalid file descriptor */
@@ -473,7 +473,7 @@ test_unlink ()
 		  strerrno (errno));
         }
       else
-	printf ("unlink 2: ret = %d chmod failed\n", ret, errno);
+	printf ("unlink 2: ret = %d chmod failed, errno= %d\n", ret, errno);
     }
   else
     printf ("unlink 2: ret = %d, errno = %d\n", ret, errno);
Index: src/gdb/testsuite/gdb.base/checkpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/checkpoint.c,v
retrieving revision 1.7
diff -u -p -r1.7 checkpoint.c
--- src/gdb/testsuite/gdb.base/checkpoint.c	3 Jan 2009 05:58:03 -0000
1.7
+++ src/gdb/testsuite/gdb.base/checkpoint.c	1 Oct 2009 14:50:34 -0000
@@ -40,9 +40,9 @@ main()
   for (i = 0; ; i++)
     {
       if (ftell (in) != i)
-	fprintf (stderr, "Input error at %d\n", i);
+	fprintf (stderr, "Input error at %ld\n", i);
       if (ftell (out) != i)
-	fprintf (stderr, "Output error at %d\n", i);
+	fprintf (stderr, "Output error at %ld\n", i);
       c = fgetc (in);
       if (c == '\n')
 	lines++;	/* breakpoint 1 */
Index: src/gdb/testsuite/gdb.threads/attachstop-mt.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/attachstop-mt.c,v
retrieving revision 1.2
diff -u -p -r1.2 attachstop-mt.c
--- src/gdb/testsuite/gdb.threads/attachstop-mt.c	3 Jan 2009 05:58:07
-0000	1.2
+++ src/gdb/testsuite/gdb.threads/attachstop-mt.c	1 Oct 2009 14:50:49
-0000
@@ -21,6 +21,7 @@
 #include <unistd.h>
 #include <pthread.h>
 #include <stdio.h>
+#include <string.h>
 
 /* Red Hat BZ PR 197584.c */
 


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