Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Andreas Jaeger committed Dec 31, 2000
1 parent 41b64fc commit bf4de8f
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 56 deletions.
4 changes: 2 additions & 2 deletions 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
Expand Down Expand Up @@ -97,5 +97,5 @@ main (int argc, char **argv)
TRYEM;
#undef TRY

exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
return lose ? EXIT_FAILURE : EXIT_SUCCESS;
}
2 changes: 1 addition & 1 deletion dirent/tst-seekdir.c
Expand Up @@ -38,5 +38,5 @@ main (int argc, char *argv[])


closedir (dirp);
exit(0);
return 0;
}
2 changes: 1 addition & 1 deletion grp/testgrp.c
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion iconvdata/tst-table-from.c
Expand Up @@ -222,5 +222,5 @@ main (int argc, char *argv[])
exit (1);
}

exit (0);
return 0;
}
4 changes: 2 additions & 2 deletions 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 <Philip.Blundell@pobox.com>.
Expand Down Expand Up @@ -61,5 +61,5 @@ main (void)
failures += result;
}
if_freenameindex (idx);
exit (failures ? 1 : 0);
return failures ? 1 : 0;
}
2 changes: 1 addition & 1 deletion io/pwd.c
Expand Up @@ -39,5 +39,5 @@ main (void)
free (dir);
}

exit (dir == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
return (dir == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
}
26 changes: 13 additions & 13 deletions io/test-utime.c
Expand Up @@ -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);

Expand All @@ -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.
Expand All @@ -73,57 +73,57 @@ 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);
if (now2 == (time_t)-1)
{
perror ("time");
remove (file);
exit (1);
return 1;
}

if (stat (file, &stnow))
{
perror ("stat");
remove (file);
exit (1);
return 1;
}

remove (file);

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;
}
2 changes: 1 addition & 1 deletion malloc/memusagestat.c
Expand Up @@ -550,7 +550,7 @@ main (int argc, char *argv[])

gdImageDestroy (im_out);

exit (0);
return 0;
}


Expand Down
3 changes: 2 additions & 1 deletion posix/test-vfork.c
Expand Up @@ -32,7 +32,8 @@ main (void)
if (waitpid (0, &status, 0) != pid
|| !WIFEXITED (status) || WEXITSTATUS (status) != NR)
exit (1);
exit (0);

return 0;
}

void
Expand Down
2 changes: 1 addition & 1 deletion posix/testfnm.c
Expand Up @@ -77,5 +77,5 @@ main (void)
++errors ;
}

exit (errors != 0);
return errors != 0;
}
3 changes: 2 additions & 1 deletion setjmp/tst-setjmp.c
Expand Up @@ -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;
}
3 changes: 2 additions & 1 deletion signal/tst-signal.c
Expand Up @@ -39,5 +39,6 @@ main (void)
}

puts ("Got a signal. Test succeeded.");
exit (EXIT_SUCCESS);

return EXIT_SUCCESS;
}
2 changes: 1 addition & 1 deletion stdio-common/temptest.c
Expand Up @@ -24,5 +24,5 @@ main (int argc, char *argv[])
for (i = 0; i < 500; i++)
remove (files[i]);

exit (0);
return 0;
}
4 changes: 2 additions & 2 deletions 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
Expand Down Expand Up @@ -125,5 +125,5 @@ main (int argc, char **argv)
puts ("Test succeeded.");
}

exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
return lose ? EXIT_FAILURE : EXIT_SUCCESS;
}
9 changes: 5 additions & 4 deletions stdio-common/tst-fileno.c
Expand Up @@ -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));
}
3 changes: 2 additions & 1 deletion stdio-common/tst-sscanf.c
Expand Up @@ -117,5 +117,6 @@ main (void)
if (! tst_locale)
break;
}
exit (result);

return result;
}
2 changes: 1 addition & 1 deletion stdio-common/tstscanf.c
Expand Up @@ -305,5 +305,5 @@ main (int argc, char **argv)
}
}

exit (result);
return result;
}
2 changes: 1 addition & 1 deletion stdlib/tst-random.c
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tst-strtod.c
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tst-strtol.c
Expand Up @@ -169,7 +169,7 @@ main (void)
}
}

exit (status ? EXIT_FAILURE : EXIT_SUCCESS);
return status ? EXIT_FAILURE : EXIT_SUCCESS;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tst-strtoll.c
Expand Up @@ -157,7 +157,7 @@ main (void)
}
}

exit (status ? EXIT_FAILURE : EXIT_SUCCESS);
return status ? EXIT_FAILURE : EXIT_SUCCESS;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion stdlib/tst-xpg-basename.c
Expand Up @@ -63,5 +63,5 @@ main (void)
}
}

exit (errors);
return errors;
}
2 changes: 1 addition & 1 deletion string/bug-strncat1.c
Expand Up @@ -27,5 +27,5 @@ main (void)
exit (1);
}

exit (0);
return 0;
}
4 changes: 2 additions & 2 deletions string/bug-strpbrk1.c
Expand Up @@ -13,7 +13,7 @@ main (void)

strpbrk (b++, "");
if (b != a + 1)
exit (1);
return 1;

exit (0);
return 0;
}
4 changes: 2 additions & 2 deletions string/bug-strspn1.c
Expand Up @@ -13,7 +13,7 @@ main (void)

strspn (b++, "");
if (b != a + 1)
exit (1);
return 1;

exit (0);
return 0;
}
4 changes: 2 additions & 2 deletions string/test-ffs.c
Expand Up @@ -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)
Expand All @@ -52,5 +52,5 @@ main (void)
else
puts ("Test succeeded.");

exit (failures);
return failures;
}
6 changes: 3 additions & 3 deletions 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
Expand Down Expand Up @@ -40,7 +40,7 @@ main (void)
char buf1[1000];
char *cp;
char ch;

cp = strcpy (buf1, "hello world");
if (strcmp ("hello world", cp++) != 0)
{
Expand Down Expand Up @@ -72,5 +72,5 @@ main (void)
status = EXIT_FAILURE;
printf ("%d errors.\n", errors);
}
exit (status);
return status;
}
2 changes: 1 addition & 1 deletion string/tst-svc.c
Expand Up @@ -41,5 +41,5 @@ main (int argc, char *argv[])
for (i = 0; i < count; ++i)
puts (str[i]);

exit (EXIT_SUCCESS);
return EXIT_SUCCESS;
}
4 changes: 2 additions & 2 deletions timezone/test-tz.c
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion wctype/test_wcfuncs.c
Expand Up @@ -84,5 +84,5 @@ main (int argc, char *argv[])

if (result == 0)
puts ("All test successful!");
exit (result);
return result != 0;
}

0 comments on commit bf4de8f

Please sign in to comment.