This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Some warnings less in the testsuite



The appended patch reduces the noise level in the testsuite.  

Ok to commit?

Andreas

2000-12-05  Andreas Jaeger  <aj@suse.de>

	* nss/test-netdb.c: Mark local functions as static to avoid
	warnings.
	(main): Use return to silence warning.

	* stdlib/test-canon.c (check_path): Mark as static to avoid warning.

	* stdio-common/test-popen.c: Mark local functions as static to
	avoid warnings.
	(main): Use return to silence warning.

	* stdlib/testsort.c (compare): Mark as static to avoid warning.

	* assert/test-assert.c: Mark local functions as static to avoid
	warnings.
	* assert/test-assert-perr.c: Likewise.

	* math/libm-test.inc (main): Use return to silence warnings.

============================================================
Index: nss/test-netdb.c
--- nss/test-netdb.c	2000/06/21 12:38:47	1.7
+++ nss/test-netdb.c	2000/12/05 07:49:01
@@ -51,7 +51,7 @@
 
 int error_count;
 
-void
+static void
 output_servent (const char *call, struct servent *sptr)
 {
   char **pptr;
@@ -68,7 +68,7 @@
 }
 
 
-void
+static void
 test_services (void)
 {
   struct servent *sptr;
@@ -112,7 +112,7 @@
 }
 
 
-void
+static void
 output_hostent (const char *call, struct hostent *hptr)
 {
   char **pptr;
@@ -134,7 +134,7 @@
     }
 }
 
-void
+static void
 test_hosts (void)
 {
   struct hostent *hptr1, *hptr2;
@@ -202,7 +202,7 @@
 }
 
 
-void
+static void
 output_netent (const char *call, struct netent *nptr)
 {
   char **pptr;
@@ -222,7 +222,7 @@
     }
 }
 
-void
+static void
 test_network (void)
 {
   struct netent *nptr;
@@ -253,7 +253,7 @@
 }
 
 
-void
+static void
 output_protoent (const char *call, struct protoent *prptr)
 {
   char **pptr;
@@ -270,7 +270,7 @@
 }
 
 
-void
+static void
 test_protocols (void)
 {
   struct protoent *prptr;
@@ -292,7 +292,7 @@
 }
 
 
-void
+static void
 output_rpcent (const char *call, struct rpcent *rptr)
 {
   char **pptr;
@@ -308,7 +308,7 @@
     }
 }
 
-void
+static void
 test_rpc (void)
 {
   struct rpcent *rptr;
@@ -329,11 +329,9 @@
   endrpcent ();
 }
 
-/*
-  Override /etc/nsswitch.conf for this program.
-  This is mainly useful for developers
-*/
-void
+/* Override /etc/nsswitch.conf for this program.  This is mainly
+   useful for developers. */
+static void  __attribute__ ((unused))
 setdb (const char *dbname)
 {
   if (strcmp ("db", dbname))
@@ -368,5 +366,5 @@
   else
     printf ("No visible errors occurred!\n");
 
-  exit (error_count);
+  return (error_count != 0);
 }
============================================================
Index: stdlib/test-canon.c
--- stdlib/test-canon.c	2000/05/17 11:02:24	1.10
+++ stdlib/test-canon.c	2000/12/05 07:49:01
@@ -93,7 +93,7 @@
 };
 
 
-int
+static int
 check_path (const char * result, const char * expected)
 {
   int good;
============================================================
Index: stdlib/testsort.c
--- stdlib/testsort.c	1997/06/12 21:02:25	1.8
+++ stdlib/testsort.c	2000/12/05 07:49:01
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int
+static int
 compare (const void *a, const void *b)
 {
   return strcmp (*(char **) a, *(char **) b);
============================================================
Index: stdio-common/test-popen.c
--- stdio-common/test-popen.c	1998/01/30 11:20:56	1.5
+++ stdio-common/test-popen.c	2000/12/05 07:49:01
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void
+static void
 write_data (FILE *stream)
 {
   int i;
@@ -33,7 +33,7 @@
     }
 }
 
-void
+static void
 read_data (FILE *stream)
 {
   int i, j;
@@ -99,5 +99,5 @@
     }
 
   puts (wstatus | rstatus  ? "Test FAILED!" : "Test succeeded.");
-  exit (wstatus | rstatus);
+  return (wstatus | rstatus);
 }
============================================================
Index: assert/test-assert.c
--- assert/test-assert.c	1998/07/04 10:18:53	1.1
+++ assert/test-assert.c	2000/12/05 07:49:01
@@ -14,7 +14,7 @@
 jmp_buf rec;
 char buf[160];
 
-void
+static void
 sigabrt (int unused)
 {
   longjmp (rec, 1);  /* recover control */
@@ -22,13 +22,13 @@
 
 #undef NDEBUG
 #include <assert.h>
-void
+static void
 assert1 (void)
 {
   assert (1 == 2);
 }
 
-void
+static void
 assert2 (void)
 {
   assert (1 == 1);
@@ -37,7 +37,7 @@
 
 #define NDEBUG
 #include <assert.h>
-void
+static void
 assert3 (void)
 {
   assert (2 == 3);
============================================================
Index: assert/test-assert-perr.c
--- assert/test-assert-perr.c	1998/07/04 10:18:41	1.1
+++ assert/test-assert-perr.c	2000/12/05 07:49:01
@@ -14,7 +14,7 @@
 jmp_buf rec;
 char buf[160];
 
-void
+static void
 sigabrt (int unused)
 {
   longjmp (rec, 1);  /* recover control */
@@ -22,13 +22,13 @@
 
 #undef NDEBUG
 #include <assert.h>
-void
+static void
 assert1 (void)
 {
   assert_perror (1);
 }
 
-void
+static void
 assert2 (void)
 {
   assert_perror (0);
@@ -36,7 +36,7 @@
 
 #define NDEBUG
 #include <assert.h>
-void
+static void
 assert3 (void)
 {
   assert_perror (2);
============================================================
Index: math/libm-test.inc
--- math/libm-test.inc	2000/10/26 17:22:21	1.18
+++ math/libm-test.inc	2000/12/05 07:49:05
@@ -4401,10 +4401,11 @@
   if (noErrors)
     {
       printf ("  %d errors occured.\n", noErrors);
-      exit (1);
+      return 1;
     }
   printf ("  All tests passed successfully.\n");
-  exit (0);
+
+  return 0;
 }
 
 /*

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

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