From bf4de8f3675839e9a6b2b20c1f4a319ad75810c9 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sun, 31 Dec 2000 10:52:32 +0000 Subject: [PATCH] * malloc/memusagestat.c (main): Use return instead of exit to avoid warning. * io/pwd.c (main): Likewise. * iconvdata/tst-table-from.c (main): Likewise. * ctype/test_ctype.c (main): Likewise. * setjmp/tst-setjmp.c (main): Likewise. * signal/tst-signal.c (main): Likewise. * stdlib/tst-strtol.c (main): Likewise. * stdlib/tst-strtod.c (main): Likewise. * stdlib/tst-strtoll.c (main): Likewise. * stdlib/tst-xpg-basename.c (main): Likewise. * dirent/tst-seekdir.c (main): Likewise. * grp/testgrp.c (main): Likewise. * inet/test_ifindex.c (main): Likewise. * io/test-utime.c (main): Likewise. * posix/test-vfork.c (main): Likewise. * posix/testfnm.c (main): Likewise. * stdio-common/temptest.c (main): Likewise. * stdio-common/test_rdwr.c (main): Likewise. * stdio-common/tst-fileno.c (main): Likewise. * stdio-common/tst-sscanf.c (main): Likewise. * stdio-common/tstscanf.c (main): Likewise. * string/bug-strncat1.c (main): Likewise. * string/bug-strpbrk1.c (main): Likewise. * string/bug-strspn1.c (main): Likewise. * string/test-ffs.c (main): Likewise. * string/tst-inlcall.c (main): Likewise. * string/tst-svc.c (main): Likewise. * timezone/test-tz.c (main): Likewise. * wctype/test_wcfuncs.c (main): Likewise. * wctype/test_wctype.c (main): Likewise. * stdlib/tst-random.c: Add attribute noreturn to fail. --- ctype/test_ctype.c | 4 ++-- dirent/tst-seekdir.c | 2 +- grp/testgrp.c | 2 +- iconvdata/tst-table-from.c | 2 +- inet/test_ifindex.c | 4 ++-- io/pwd.c | 2 +- io/test-utime.c | 26 +++++++++++++------------- malloc/memusagestat.c | 2 +- posix/test-vfork.c | 3 ++- posix/testfnm.c | 2 +- setjmp/tst-setjmp.c | 3 ++- signal/tst-signal.c | 3 ++- stdio-common/temptest.c | 2 +- stdio-common/test_rdwr.c | 4 ++-- stdio-common/tst-fileno.c | 9 +++++---- stdio-common/tst-sscanf.c | 3 ++- stdio-common/tstscanf.c | 2 +- stdlib/tst-random.c | 2 +- stdlib/tst-strtod.c | 2 +- stdlib/tst-strtol.c | 2 +- stdlib/tst-strtoll.c | 2 +- stdlib/tst-xpg-basename.c | 2 +- string/bug-strncat1.c | 2 +- string/bug-strpbrk1.c | 4 ++-- string/bug-strspn1.c | 4 ++-- string/test-ffs.c | 4 ++-- string/tst-inlcall.c | 6 +++--- string/tst-svc.c | 2 +- timezone/test-tz.c | 4 ++-- wctype/test_wcfuncs.c | 2 +- wctype/test_wctype.c | 4 ++-- 31 files changed, 61 insertions(+), 56 deletions(-) diff --git a/ctype/test_ctype.c b/ctype/test_ctype.c index a1f72492eb..ebebe8f297 100644 --- a/ctype/test_ctype.c +++ b/ctype/test_ctype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1996, 1997, 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 @@ -97,5 +97,5 @@ main (int argc, char **argv) TRYEM; #undef TRY - exit (lose ? EXIT_FAILURE : EXIT_SUCCESS); + return lose ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/dirent/tst-seekdir.c b/dirent/tst-seekdir.c index 5a5c7fdd36..f4d99ae632 100644 --- a/dirent/tst-seekdir.c +++ b/dirent/tst-seekdir.c @@ -38,5 +38,5 @@ main (int argc, char *argv[]) closedir (dirp); - exit(0); + return 0; } diff --git a/grp/testgrp.c b/grp/testgrp.c index 62ba4e4a62..892cfaaa21 100644 --- a/grp/testgrp.c +++ b/grp/testgrp.c @@ -37,5 +37,5 @@ main (int argc, char *argv[]) } } - exit (my_passwd && my_group ? EXIT_SUCCESS : EXIT_FAILURE); + return my_passwd && my_group ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/iconvdata/tst-table-from.c b/iconvdata/tst-table-from.c index fb4934f0de..5a2fa9d47a 100644 --- a/iconvdata/tst-table-from.c +++ b/iconvdata/tst-table-from.c @@ -222,5 +222,5 @@ main (int argc, char *argv[]) exit (1); } - exit (0); + return 0; } diff --git a/inet/test_ifindex.c b/inet/test_ifindex.c index 0441bf0feb..62a7326b9e 100644 --- a/inet/test_ifindex.c +++ b/inet/test_ifindex.c @@ -1,5 +1,5 @@ /* Test interface name <-> index conversions. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell . @@ -61,5 +61,5 @@ main (void) failures += result; } if_freenameindex (idx); - exit (failures ? 1 : 0); + return failures ? 1 : 0; } diff --git a/io/pwd.c b/io/pwd.c index 21f4e51541..1624dc49a3 100644 --- a/io/pwd.c +++ b/io/pwd.c @@ -39,5 +39,5 @@ main (void) free (dir); } - exit (dir == NULL ? EXIT_FAILURE : EXIT_SUCCESS); + return (dir == NULL ? EXIT_FAILURE : EXIT_SUCCESS); } diff --git a/io/test-utime.c b/io/test-utime.c index 8dbbcf990d..6828d00581 100644 --- a/io/test-utime.c +++ b/io/test-utime.c @@ -37,14 +37,14 @@ main (int argc, char *argv[]) if (tmpnam (file) == 0) { perror ("tmpnam"); - exit (1); + return 1; } fd = creat (file, 0666); if (fd < 0) { perror ("creat"); - exit (1); + return 1; } close (fd); @@ -55,14 +55,14 @@ main (int argc, char *argv[]) { perror ("utime"); remove (file); - exit (1); + return 1; } if (stat (file, &st)) { perror ("stat"); remove (file); - exit (1); + return 1; } /* Test utime with NULL. @@ -73,14 +73,14 @@ main (int argc, char *argv[]) { perror ("time"); remove (file); - exit (1); + return 1; } if (utime (file, NULL)) { perror ("utime NULL"); remove (file); - exit (1); + return 1; } now2 = time (NULL); @@ -88,14 +88,14 @@ main (int argc, char *argv[]) { perror ("time"); remove (file); - exit (1); + return 1; } if (stat (file, &stnow)) { perror ("stat"); remove (file); - exit (1); + return 1; } remove (file); @@ -103,27 +103,27 @@ main (int argc, char *argv[]) if (st.st_mtime != ut.modtime) { printf ("modtime %ld != %ld\n", st.st_mtime, ut.modtime); - exit (1); + return 1; } if (st.st_atime != ut.actime) { printf ("actime %ld != %ld\n", st.st_atime, ut.actime); - exit (1); + return 1; } if (stnow.st_mtime < now1 || stnow.st_mtime > now2) { printf ("modtime %ld <%ld >%ld\n", st.st_mtime, now1, now2); - exit (1); + return 1; } if (stnow.st_atime < now1 || stnow.st_atime > now2) { printf ("actime %ld <%ld >%ld\n", st.st_atime, now1, now2); - exit (1); + return 1; } puts ("Test succeeded."); - exit (0); + return 0; } diff --git a/malloc/memusagestat.c b/malloc/memusagestat.c index 1da0ff0ce9..0b01a1d6b5 100644 --- a/malloc/memusagestat.c +++ b/malloc/memusagestat.c @@ -550,7 +550,7 @@ main (int argc, char *argv[]) gdImageDestroy (im_out); - exit (0); + return 0; } diff --git a/posix/test-vfork.c b/posix/test-vfork.c index 66c17c3d90..dd2b1c7727 100644 --- a/posix/test-vfork.c +++ b/posix/test-vfork.c @@ -32,7 +32,8 @@ main (void) if (waitpid (0, &status, 0) != pid || !WIFEXITED (status) || WEXITSTATUS (status) != NR) exit (1); - exit (0); + + return 0; } void diff --git a/posix/testfnm.c b/posix/testfnm.c index a8b85c56ad..b735a26579 100644 --- a/posix/testfnm.c +++ b/posix/testfnm.c @@ -77,5 +77,5 @@ main (void) ++errors ; } - exit (errors != 0); + return errors != 0; } diff --git a/setjmp/tst-setjmp.c b/setjmp/tst-setjmp.c index 90dac0585c..c1efca5410 100644 --- a/setjmp/tst-setjmp.c +++ b/setjmp/tst-setjmp.c @@ -113,5 +113,6 @@ main (void) puts ("Test FAILED!"); else puts ("Test succeeded!"); - exit (lose ? EXIT_FAILURE : EXIT_SUCCESS); + + return lose ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/signal/tst-signal.c b/signal/tst-signal.c index ef792e8cbf..6d3178792a 100644 --- a/signal/tst-signal.c +++ b/signal/tst-signal.c @@ -39,5 +39,6 @@ main (void) } puts ("Got a signal. Test succeeded."); - exit (EXIT_SUCCESS); + + return EXIT_SUCCESS; } diff --git a/stdio-common/temptest.c b/stdio-common/temptest.c index ec8e179f03..c8cf8529f1 100644 --- a/stdio-common/temptest.c +++ b/stdio-common/temptest.c @@ -24,5 +24,5 @@ main (int argc, char *argv[]) for (i = 0; i < 500; i++) remove (files[i]); - exit (0); + return 0; } diff --git a/stdio-common/test_rdwr.c b/stdio-common/test_rdwr.c index a3b01b7c7c..477069bb5a 100644 --- a/stdio-common/test_rdwr.c +++ b/stdio-common/test_rdwr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1991,1992,1996,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 @@ -125,5 +125,5 @@ main (int argc, char **argv) puts ("Test succeeded."); } - exit (lose ? EXIT_FAILURE : EXIT_SUCCESS); + return lose ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/stdio-common/tst-fileno.c b/stdio-common/tst-fileno.c index 79c768d732..3cc37a9876 100644 --- a/stdio-common/tst-fileno.c +++ b/stdio-common/tst-fileno.c @@ -24,14 +24,15 @@ static int check (const char *name, FILE *stream, int fd) { int sfd = fileno (stream); - printf ("(fileno (%s) = %d) %c= %d\n", name, sfd, sfd == fd ? '=' : '!', fd); + printf ("(fileno (%s) = %d) %c= %d\n", name, sfd, + sfd == fd ? '=' : '!', fd); return sfd != fd; } int main (void) { - exit (check ("stdin", stdin, STDIN_FILENO) || - check ("stdout", stdout, STDOUT_FILENO) || - check ("stderr", stderr, STDERR_FILENO)); + return (check ("stdin", stdin, STDIN_FILENO) || + check ("stdout", stdout, STDOUT_FILENO) || + check ("stderr", stderr, STDERR_FILENO)); } diff --git a/stdio-common/tst-sscanf.c b/stdio-common/tst-sscanf.c index c0d3c36f4b..d5a0397559 100644 --- a/stdio-common/tst-sscanf.c +++ b/stdio-common/tst-sscanf.c @@ -117,5 +117,6 @@ main (void) if (! tst_locale) break; } - exit (result); + + return result; } diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c index 6cf5738416..827f5adcc8 100644 --- a/stdio-common/tstscanf.c +++ b/stdio-common/tstscanf.c @@ -305,5 +305,5 @@ main (int argc, char **argv) } } - exit (result); + return result; } diff --git a/stdlib/tst-random.c b/stdlib/tst-random.c index 3453d794c4..2cc8e9c60c 100644 --- a/stdlib/tst-random.c +++ b/stdlib/tst-random.c @@ -44,7 +44,7 @@ const int nseq = 3; /* number of test sequences */ const int nrnd = 50; /* length of each test sequence */ const unsigned int seed[3] = { 0x12344321U, 0xEE11DD22U, 0xFEDCBA98 }; -void fail (const char *msg, int s, int i); +void fail (const char *msg, int s, int i) __attribute__ ((__noreturn__)); int main (void) diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c index ffd3975020..01c454261f 100644 --- a/stdlib/tst-strtod.c +++ b/stdlib/tst-strtod.c @@ -117,7 +117,7 @@ main (int argc, char ** argv) status |= long_dbl (); - exit (status ? EXIT_FAILURE : EXIT_SUCCESS); + return status ? EXIT_FAILURE : EXIT_SUCCESS; } static void diff --git a/stdlib/tst-strtol.c b/stdlib/tst-strtol.c index ae8fdd4905..db065d6f0a 100644 --- a/stdlib/tst-strtol.c +++ b/stdlib/tst-strtol.c @@ -169,7 +169,7 @@ main (void) } } - exit (status ? EXIT_FAILURE : EXIT_SUCCESS); + return status ? EXIT_FAILURE : EXIT_SUCCESS; } static void diff --git a/stdlib/tst-strtoll.c b/stdlib/tst-strtoll.c index 1cc72823b6..9007488d80 100644 --- a/stdlib/tst-strtoll.c +++ b/stdlib/tst-strtoll.c @@ -157,7 +157,7 @@ main (void) } } - exit (status ? EXIT_FAILURE : EXIT_SUCCESS); + return status ? EXIT_FAILURE : EXIT_SUCCESS; } static void diff --git a/stdlib/tst-xpg-basename.c b/stdlib/tst-xpg-basename.c index 12067e702d..8e2d965394 100644 --- a/stdlib/tst-xpg-basename.c +++ b/stdlib/tst-xpg-basename.c @@ -63,5 +63,5 @@ main (void) } } - exit (errors); + return errors; } diff --git a/string/bug-strncat1.c b/string/bug-strncat1.c index 3491aa7d1f..f1b5c37c5c 100644 --- a/string/bug-strncat1.c +++ b/string/bug-strncat1.c @@ -27,5 +27,5 @@ main (void) exit (1); } - exit (0); + return 0; } diff --git a/string/bug-strpbrk1.c b/string/bug-strpbrk1.c index 3fdc930c3e..28238b0f50 100644 --- a/string/bug-strpbrk1.c +++ b/string/bug-strpbrk1.c @@ -13,7 +13,7 @@ main (void) strpbrk (b++, ""); if (b != a + 1) - exit (1); + return 1; - exit (0); + return 0; } diff --git a/string/bug-strspn1.c b/string/bug-strspn1.c index f637b97ef0..a657bafc43 100644 --- a/string/bug-strspn1.c +++ b/string/bug-strspn1.c @@ -13,7 +13,7 @@ main (void) strspn (b++, ""); if (b != a + 1) - exit (1); + return 1; - exit (0); + return 0; } diff --git a/string/test-ffs.c b/string/test-ffs.c index 8d46d4e076..9bc0796a1e 100644 --- a/string/test-ffs.c +++ b/string/test-ffs.c @@ -29,7 +29,7 @@ main (void) int i; auto void try (int value, int expected); - + void try (int value, int expected) { if (ffs (value) != expected) @@ -52,5 +52,5 @@ main (void) else puts ("Test succeeded."); - exit (failures); + return failures; } diff --git a/string/tst-inlcall.c b/string/tst-inlcall.c index 1e39ee4870..3557bff84f 100644 --- a/string/tst-inlcall.c +++ b/string/tst-inlcall.c @@ -1,5 +1,5 @@ /* Tester for calling inline string functions. - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 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 @@ -40,7 +40,7 @@ main (void) char buf1[1000]; char *cp; char ch; - + cp = strcpy (buf1, "hello world"); if (strcmp ("hello world", cp++) != 0) { @@ -72,5 +72,5 @@ main (void) status = EXIT_FAILURE; printf ("%d errors.\n", errors); } - exit (status); + return status; } diff --git a/string/tst-svc.c b/string/tst-svc.c index 30a161e70a..1ee5342aa9 100644 --- a/string/tst-svc.c +++ b/string/tst-svc.c @@ -41,5 +41,5 @@ main (int argc, char *argv[]) for (i = 0; i < count; ++i) puts (str[i]); - exit (EXIT_SUCCESS); + return EXIT_SUCCESS; } diff --git a/timezone/test-tz.c b/timezone/test-tz.c index af37d8ae6a..642b45a0ed 100644 --- a/timezone/test-tz.c +++ b/timezone/test-tz.c @@ -46,11 +46,11 @@ main (int argc, char ** argv) if (errors == 0) { puts ("No errors."); - exit (EXIT_SUCCESS); + return EXIT_SUCCESS; } else { printf ("%d errors.\n", errors); - exit (EXIT_FAILURE); + return EXIT_FAILURE; } } diff --git a/wctype/test_wcfuncs.c b/wctype/test_wcfuncs.c index 61328ea22d..8e4c2823b4 100644 --- a/wctype/test_wcfuncs.c +++ b/wctype/test_wcfuncs.c @@ -84,5 +84,5 @@ main (int argc, char *argv[]) if (result == 0) puts ("All test successful!"); - exit (result); + return result != 0; } diff --git a/wctype/test_wctype.c b/wctype/test_wctype.c index 1c9bf5aa3b..e1fa45a1e5 100644 --- a/wctype/test_wctype.c +++ b/wctype/test_wctype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 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 @@ -79,5 +79,5 @@ main (int argc, char *argv[]) if (result == 0) puts ("All test successful!"); - exit (result); + return result; }