[rtems commit] testsuites: Fix warnings

Sebastian Huber sebh at rtems.org
Thu Apr 11 12:03:38 UTC 2013


Module:    rtems
Branch:    master
Commit:    7b369afba9fecbf8a87a42375376d4ca8af7560c
Changeset: http://git.rtems.org/rtems/commit/?id=7b369afba9fecbf8a87a42375376d4ca8af7560c

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Apr 11 13:58:33 2013 +0200

testsuites: Fix warnings

---

 testsuites/fstests/fsbdpart01/init.c        |    3 ++
 testsuites/fstests/support/fstest_support.c |    2 +-
 testsuites/psxtests/psxfile01/psxfile01.scn |   47 +++++++++++++++++----------
 testsuites/psxtests/psxfile01/test.c        |   12 ++++---
 testsuites/psxtmtests/psxtmcond05/init.c    |    1 +
 testsuites/psxtmtests/psxtmcond08/init.c    |    5 +--
 testsuites/psxtmtests/psxtmthread02/init.c  |    5 ++-
 testsuites/sptests/spatomic02/init.c        |    1 -
 testsuites/sptests/spatomic03/init.c        |    1 -
 testsuites/sptests/spatomic04/init.c        |    1 -
 testsuites/sptests/spatomic05/init.c        |    1 -
 testsuites/sptests/spatomic06/init.c        |    1 -
 testsuites/sptests/spatomic07/init.c        |    1 -
 testsuites/sptests/spinternalerror01/init.c |    2 -
 testsuites/sptests/spinternalerror02/init.c |    8 ++--
 15 files changed, 51 insertions(+), 40 deletions(-)

diff --git a/testsuites/fstests/fsbdpart01/init.c b/testsuites/fstests/fsbdpart01/init.c
index bf6719c..b94afdc 100644
--- a/testsuites/fstests/fsbdpart01/init.c
+++ b/testsuites/fstests/fsbdpart01/init.c
@@ -196,7 +196,10 @@ static void test_ide_part_table(void)
   rtems_status_code sc = RTEMS_SUCCESSFUL;
 
   test_logical_disks(&ide_part_table_rdax [0], false);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
   sc = rtems_ide_part_table_initialize(rda);
+#pragma GCC diagnostic pop
   ASSERT_SC(sc);
   test_logical_disks(&ide_part_table_rdax [0], true);
 }
diff --git a/testsuites/fstests/support/fstest_support.c b/testsuites/fstests/support/fstest_support.c
index 164ef7b..56526a9 100644
--- a/testsuites/fstests/support/fstest_support.c
+++ b/testsuites/fstests/support/fstest_support.c
@@ -29,7 +29,7 @@
 #include "fstest.h"
 #include "pmacros.h"
 
-volatile void *prevent_compiler_optimizations;
+void *volatile prevent_compiler_optimizations;
 
 /* Break out of a chroot() environment in C */
 static void break_out_of_chroot(void)
diff --git a/testsuites/psxtests/psxfile01/psxfile01.scn b/testsuites/psxtests/psxfile01/psxfile01.scn
index 6a80e54..5cdd609 100644
--- a/testsuites/psxtests/psxfile01/psxfile01.scn
+++ b/testsuites/psxtests/psxfile01/psxfile01.scn
@@ -2,11 +2,14 @@
 *************** Dump of Entire IMFS ***************
 /
 ....dev/
+........console_a (device 0, 0)
 ........console (device 0, 0)
+........console_b (device 0, 1)
 ***************      End of Dump       ***************
 stat of /dev/console
 ....st_dev     (0xfffe:0x0)
-....st_ino     3  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     4  may vary by small amount
 ....mode  = 00020755
 ....nlink = 1
 ....uid = 0
@@ -14,7 +17,7 @@ stat of /dev/console
 ....atime = Fri Jan  1 00:00:00 1988
 ....mtime = Fri Jan  1 00:00:00 1988
 ....ctime = Fri Jan  1 00:00:00 1988
-....st_blksize 80
+....st_blksize 0
 ....st_blocks  0
 
 mkdir /dev/tty
@@ -31,7 +34,6 @@ rmdir /usr
 rmdir /dev
 rmdir /fred
 rmdir /tmp/bha
-unlink /dev/tty
 mknod /dev/test_console
 mknod /dev/tty/S3
 mknod /etc/passwd
@@ -48,7 +50,6 @@ unlink /tmp
 create and close /tmp/tom
 Attempt to recreate /tmp/tom
 create /tmp/john
-tcdrain /tmp/john
 Attempt to create a file, open in read-only mode and truncate it
 Exercise the reentrant version _link_r -- Expect ENOENT
 Unlink /tmp/bha using the reentrant version -- OK
@@ -85,7 +86,8 @@ End of _rename_r tests
 
 stat( /tmp/joel ) returned 
 ....st_dev     (0xfffe:0x0)
-....st_ino     15  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     17  may vary by small amount
 ....mode  = 00100700
 ....nlink = 1
 ....uid = 0
@@ -118,7 +120,8 @@ Skipping maximum file size test since max_size is 4329344 bytes
 That is likely to be bigger than the available RAM on many targets.
 stat( /tmp/joel ) returned 
 ....st_dev     (0xfffe:0x0)
-....st_ino     16  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     18  may vary by small amount
 ....mode  = 00100700
 ....nlink = 1
 ....uid = 0
@@ -130,16 +133,17 @@ stat( /tmp/joel ) returned
 ....st_blocks  0
 stat of /tmp/j
 stat(/tmp/j) returned -1 (errno=2)
-....st_dev     (0xfffe:0x0)
-....st_ino     3  may vary by small amount
-....mode  = 00020755
-....nlink = 1
+....st_dev     (0x0:0x0)
+....st_rdev    (0x0:0x0)
+....st_ino     0  may vary by small amount
+....mode  = 00000000
+....nlink = 0
 ....uid = 0
 ....gid = 0
-....atime = Fri Jan  1 00:00:00 1988
-....mtime = Fri Jan  1 00:00:00 1988
-....ctime = Fri Jan  1 00:00:00 1988
-....st_blksize 80
+....atime = Thu Jan  1 00:00:00 1970
+....mtime = Thu Jan  1 00:00:00 1970
+....ctime = Thu Jan  1 00:00:00 1970
+....st_blksize 0
 ....st_blocks  0
 fopen of /tmp/j
 fprintf to /tmp/j
@@ -149,7 +153,8 @@ fprintf to /tmp/j
 (4) 26 characters written to the file
 (5) 26 characters written to the file
 ....st_dev     (0xfffe:0x0)
-....st_ino     17  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     19  may vary by small amount
 ....mode  = 00100644
 ....nlink = 1
 ....uid = 0
@@ -165,7 +170,8 @@ This is call 3 to fprintf
 This is call 4 to fprintf
 This is call 5 to fprintf
 ....st_dev     (0xfffe:0x0)
-....st_ino     17  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     19  may vary by small amount
 ....mode  = 00100644
 ....nlink = 1
 ....uid = 0
@@ -178,7 +184,9 @@ This is call 5 to fprintf
 *************** Dump of Entire IMFS ***************
 /
 ....dev/
+........console_a (device 0, 0)
 ........console (device 0, 0)
+........console_b (device 0, 1)
 ........tty/
 ............S3 (device 255, 128)
 ........test_console (device 0, 0)
@@ -195,7 +203,8 @@ This is call 5 to fprintf
 ***************      End of Dump       ***************
 truncate /tmp/j to length of 40
 ....st_dev     (0xfffe:0x0)
-....st_ino     17  may vary by small amount
+....st_rdev    (0x0:0x0)
+....st_ino     19  may vary by small amount
 ....mode  = 00100644
 ....nlink = 1
 ....uid = 0
@@ -208,7 +217,9 @@ truncate /tmp/j to length of 40
 *************** Dump of Entire IMFS ***************
 /
 ....dev/
+........console_a (device 0, 0)
 ........console (device 0, 0)
+........console_b (device 0, 1)
 ........tty/
 ............S3 (device 255, 128)
 ........test_console (device 0, 0)
@@ -229,7 +240,9 @@ truncate /tmp to length of 0 should fail with EISDIR
 *************** Dump of Entire IMFS ***************
 /
 ....dev/
+........console_a (device 0, 0)
 ........console (device 0, 0)
+........console_b (device 0, 1)
 ........tty/
 ............S3 (device 255, 128)
 ........test_console (device 0, 0)
diff --git a/testsuites/psxtests/psxfile01/test.c b/testsuites/psxtests/psxfile01/test.c
index d817e65..4d7fe0b 100644
--- a/testsuites/psxtests/psxfile01/test.c
+++ b/testsuites/psxtests/psxfile01/test.c
@@ -35,6 +35,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <string.h>
+#include <inttypes.h>
 #include <ctype.h>
 #include <reent.h>
 #include <rtems/imfs.h>
@@ -80,15 +81,16 @@ void test_extend(
  */
 void dump_statbuf( struct stat *buf )
 {
-  int         major1;
-  int         minor1;
-  int         major2;
-  int         minor2;
+  rtems_device_major_number major1;
+  rtems_device_minor_number minor1;
+  rtems_device_major_number major2;
+  rtems_device_minor_number minor2;
 
   rtems_filesystem_split_dev_t( buf->st_dev, major1, minor1 );
   rtems_filesystem_split_dev_t( buf->st_rdev, major2, minor2 );
 
-  printf( "....st_dev     (0x%x:0x%x)\n", major1, minor1 );
+  printf( "....st_dev     (0x%" PRIx32 ":0x%" PRIx32 ")\n", major1, minor1 );
+  printf( "....st_rdev    (0x%" PRIx32 ":0x%" PRIx32 ")\n", major2, minor2 );
   printf( "....st_ino     %" PRIxino_t "  may vary by small amount\n", buf->st_ino );
   printf( "....mode  = %08" PRIomode_t "\n", buf->st_mode );
   printf( "....nlink = %d\n", buf->st_nlink );
diff --git a/testsuites/psxtmtests/psxtmcond05/init.c b/testsuites/psxtmtests/psxtmcond05/init.c
index bf4de19..8941ee3 100644
--- a/testsuites/psxtmtests/psxtmcond05/init.c
+++ b/testsuites/psxtmtests/psxtmcond05/init.c
@@ -12,6 +12,7 @@
 #endif
 
 #include <timesys.h>
+#include <pthread.h>
 #include <rtems/timerdrv.h>
 #include "test_support.h"
 
diff --git a/testsuites/psxtmtests/psxtmcond08/init.c b/testsuites/psxtmtests/psxtmcond08/init.c
index af97036..fe1fee7 100644
--- a/testsuites/psxtmtests/psxtmcond08/init.c
+++ b/testsuites/psxtmtests/psxtmcond08/init.c
@@ -27,6 +27,7 @@
 #include <stdio.h>
 #include <time.h>
 #include <errno.h>
+#include <sched.h>
 #include <timesys.h>
 #include <tmacros.h>
 #include <rtems/timerdrv.h>
@@ -88,16 +89,14 @@ void *Middle(
 
   #elif defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST)
     {
-      long end_time;
-
       /* override sleepTime with something obviously in the past */
       sleepTime.tv_sec = 0;
       sleepTime.tv_nsec = 5;
 
       /* this does all the work of timedwait but immediately returns */
       rc = pthread_cond_timedwait( &CondID, &MutexID, &sleepTime );
-      end_time = benchmark_timer_read();
       rtems_test_assert(rc == ETIMEDOUT);
+      benchmark_timer_read();
     }
   #endif
 
diff --git a/testsuites/psxtmtests/psxtmthread02/init.c b/testsuites/psxtmtests/psxtmthread02/init.c
index 41fb17f..9e44873 100644
--- a/testsuites/psxtmtests/psxtmthread02/init.c
+++ b/testsuites/psxtmtests/psxtmthread02/init.c
@@ -19,7 +19,7 @@
 /* forward declarations to avoid warnings */
 void *POSIX_Init(void *argument);
 void benchmark_pthread_create(void);
-void thread(void *argument);
+void *thread(void *argument);
 
 void benchmark_pthread_create(void)
 {
@@ -46,11 +46,12 @@ void benchmark_pthread_create(void)
 
 }
 
-void thread(
+void *thread(
   void *argument
 )
 {
   //Empty thread used in pthread_create().
+  return NULL;
 }
 
 void *POSIX_Init(
diff --git a/testsuites/sptests/spatomic02/init.c b/testsuites/sptests/spatomic02/init.c
index 0c1b32e..7eec1ea 100644
--- a/testsuites/sptests/spatomic02/init.c
+++ b/testsuites/sptests/spatomic02/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic02 TEST ***\n" );
diff --git a/testsuites/sptests/spatomic03/init.c b/testsuites/sptests/spatomic03/init.c
index 3f06d0e..946797e 100644
--- a/testsuites/sptests/spatomic03/init.c
+++ b/testsuites/sptests/spatomic03/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic03 TEST ***\n" );
diff --git a/testsuites/sptests/spatomic04/init.c b/testsuites/sptests/spatomic04/init.c
index 655b081..f0b0751 100644
--- a/testsuites/sptests/spatomic04/init.c
+++ b/testsuites/sptests/spatomic04/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic04 TEST ***\n" );
diff --git a/testsuites/sptests/spatomic05/init.c b/testsuites/sptests/spatomic05/init.c
index 891af28..328d417 100644
--- a/testsuites/sptests/spatomic05/init.c
+++ b/testsuites/sptests/spatomic05/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic05 TEST ***\n" );
diff --git a/testsuites/sptests/spatomic06/init.c b/testsuites/sptests/spatomic06/init.c
index 775c6bc..4a7ecfc 100644
--- a/testsuites/sptests/spatomic06/init.c
+++ b/testsuites/sptests/spatomic06/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic06 TEST ***\n" );
diff --git a/testsuites/sptests/spatomic07/init.c b/testsuites/sptests/spatomic07/init.c
index 8d03464..3cc1b27 100644
--- a/testsuites/sptests/spatomic07/init.c
+++ b/testsuites/sptests/spatomic07/init.c
@@ -23,7 +23,6 @@ rtems_task Init(
   char               ch;
   rtems_id           id;
   rtems_status_code  status;
-  bool               allDone;
 
   /* Put start of test message */
   puts( "\n\n***  spatomic07 TEST ***\n" );
diff --git a/testsuites/sptests/spinternalerror01/init.c b/testsuites/sptests/spinternalerror01/init.c
index a551af1..8962410 100644
--- a/testsuites/sptests/spinternalerror01/init.c
+++ b/testsuites/sptests/spinternalerror01/init.c
@@ -28,8 +28,6 @@
 void boot_card( const char *cmdline )
 {
   _Internal_error_Occurred( FATAL_SOURCE, FATAL_IS_INTERNAL, FATAL_ERROR );
-
-  return 0;
 }
 
 static void fatal_extension(
diff --git a/testsuites/sptests/spinternalerror02/init.c b/testsuites/sptests/spinternalerror02/init.c
index 8bfb650..4b89e6c 100644
--- a/testsuites/sptests/spinternalerror02/init.c
+++ b/testsuites/sptests/spinternalerror02/init.c
@@ -23,8 +23,8 @@
 static void test_internal_error_description(void)
 {
   rtems_fatal_code error = 0;
-  const char *desc_last = NULL;
-  const char *desc;
+  const char *desc = NULL;
+  const char *desc_last;
 
   do {
     desc_last = desc;
@@ -39,8 +39,8 @@ static void test_internal_error_description(void)
 static void test_fatal_source_description(void)
 {
   rtems_fatal_source source = 0;
-  const char *desc_last = NULL;
-  const char *desc;
+  const char *desc = NULL;
+  const char *desc_last;
 
   do {
     desc_last = desc;




More information about the vc mailing list