From 595538976b5d13ea0bcff73e05a9b6fd6cddaee5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 20 Nov 2000 17:40:29 +0000 Subject: [PATCH] Update. 2000-11-20 Jakub Jelinek * iconvdata/bug-iconv2.c (main): Use %zd in format string. * io/test-lfs.c (do_test): Cast statbuf.st_size to long long. * malloc/tst-valloc.c (main): Cast valloc return value to long. * malloc/tst-obstack.c (verbose_malloc): Use %zd in format string. * math/test-fpucw.c (main): Use %lx in format string, cast control words to long. * stdio-common/tst-fmemopen.c (main): Use %td in format strings. * stdlib/tst-strtol.c (tests): Avoid (bogus?) decimal constant is so large that it is unsigned warning. * sysdeps/unix/sysv/linux/sparc/bits/types.h (__ssize_t): Changing it to long on sparc64. 2000-11-20 Andreas Jaeger * nscd/nscd.h (termination_handler): Add noreturn attribute. (receiv_print_stats): Likewise. * elf/ldconfig.c (path_hwcap): Cast -1 for proper comparison. --- ChangeLog | 22 ++++++++++++++++++++++ elf/ldconfig.c | 10 ++++++---- iconvdata/bug-iconv2.c | 2 +- io/test-lfs.c | 4 ++-- linuxthreads/ChangeLog | 10 ++++++++++ linuxthreads/Examples/ex11.c | 6 ++++-- linuxthreads/Examples/ex14.c | 4 ++-- linuxthreads/Examples/ex3.c | 4 ++-- linuxthreads/Examples/ex8.c | 4 ++-- linuxthreads/ecmutex.c | 6 +++--- malloc/tst-obstack.c | 2 +- malloc/tst-valloc.c | 14 ++++++++------ math/test-fpucw.c | 4 ++-- nscd/nscd.h | 4 ++-- stdio-common/tst-fmemopen.c | 4 ++-- stdlib/tst-strtol.c | 4 ++-- sysdeps/unix/sysv/linux/sparc/bits/types.h | 2 +- 17 files changed, 72 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7b9ee3c27..476d9f1dd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2000-11-20 Jakub Jelinek + + * iconvdata/bug-iconv2.c (main): Use %zd in format string. + * io/test-lfs.c (do_test): Cast statbuf.st_size to long long. + * malloc/tst-valloc.c (main): Cast valloc return value to long. + * malloc/tst-obstack.c (verbose_malloc): Use %zd in format string. + * math/test-fpucw.c (main): Use %lx in format string, cast + control words to long. + * stdio-common/tst-fmemopen.c (main): Use %td in format strings. + * stdlib/tst-strtol.c (tests): Avoid (bogus?) decimal constant is so + large that it is unsigned warning. + + * sysdeps/unix/sysv/linux/sparc/bits/types.h (__ssize_t): Changing + it to long on sparc64. + +2000-11-20 Andreas Jaeger + + * nscd/nscd.h (termination_handler): Add noreturn attribute. + (receiv_print_stats): Likewise. + + * elf/ldconfig.c (path_hwcap): Cast -1 for proper comparison. + 2000-11-20 Ulrich Drepper * malloc/thread-m.h: gcc doesn't tolerate zero-sized types anymore. diff --git a/elf/ldconfig.c b/elf/ldconfig.c index 068f43e1b9..9ee5a7d484 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c @@ -191,10 +191,12 @@ path_hwcap (const char *path) h = _dl_string_hwcap (ptr + 1); - if (h == -1) - h = _dl_string_platform (ptr + 1); - if (h == -1) - break; + if (h == (uint64_t) -1) + { + h = _dl_string_platform (ptr + 1); + if (h == (uint64_t) -1) + break; + } hwcap += 1ULL << h; /* Search the next part of the path. */ diff --git a/iconvdata/bug-iconv2.c b/iconvdata/bug-iconv2.c index a2bf44f419..4bd45507ab 100644 --- a/iconvdata/bug-iconv2.c +++ b/iconvdata/bug-iconv2.c @@ -38,7 +38,7 @@ main (void) exit (1); puts ("This used to crash"); - printf ("%d\n", iconv (cd_a, &from, &from_left, &to, &to_left)); + printf ("%zd\n", iconv (cd_a, &from, &from_left, &to, &to_left)); iconv_close (cd_a); puts ("works now"); diff --git a/io/test-lfs.c b/io/test-lfs.c index f4aa67f96a..b423a10f08 100644 --- a/io/test-lfs.c +++ b/io/test-lfs.c @@ -122,9 +122,9 @@ do_test (int argc, char *argv[]) error (0, errno, "stat64 is not supported"); else if (ret == -1) error (EXIT_FAILURE, errno, "cannot stat file `%s'", name); - else if (statbuf.st_size != (TWO_GB+100+5)) + else if (statbuf.st_size != (TWO_GB + 100 + 5)) error (EXIT_FAILURE, 0, "stat reported size %lld instead of %lld.", - statbuf.st_size, (TWO_GB+100+5)); + (long long int) statbuf.st_size, (TWO_GB + 100 + 5)); return 0; } diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 685f8ef04f..215ceff586 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,13 @@ +2000-11-20 Jakub Jelinek + + * Examples/ex3.c (main): Cast int to long before casting to void *. + (search): Cast void * to long, not int. + * Examples/ex8.c (main, thread): Similarly. + * Examples/ex11.c (main): Similarly. + * Examples/ex14.c (worker, do_test): Similarly. + * ecmutex.c (worker, do_test): Similarly. + (nlocks): Cast to int. + 2000-11-08 Bruce Mitchener * linuxthreads.texi: Add documentation for pthreads attributes diff --git a/linuxthreads/Examples/ex11.c b/linuxthreads/Examples/ex11.c index fb09d64561..a01d18db36 100644 --- a/linuxthreads/Examples/ex11.c +++ b/linuxthreads/Examples/ex11.c @@ -128,7 +128,8 @@ main (void) for (n = 0; n < NWRITERS; ++n) { - int err = pthread_create (&thwr[n], NULL, writer_thread, (void *) n); + int err = pthread_create (&thwr[n], NULL, writer_thread, + (void *) (long int) n); if (err != 0) error (EXIT_FAILURE, err, "cannot create writer thread"); @@ -136,7 +137,8 @@ main (void) for (n = 0; n < NREADERS; ++n) { - int err = pthread_create (&thrd[n], NULL, reader_thread, (void *) n); + int err = pthread_create (&thrd[n], NULL, reader_thread, + (void *) (long int) n); if (err != 0) error (EXIT_FAILURE, err, "cannot create reader thread"); diff --git a/linuxthreads/Examples/ex14.c b/linuxthreads/Examples/ex14.c index 9d2c987347..7788e521b8 100644 --- a/linuxthreads/Examples/ex14.c +++ b/linuxthreads/Examples/ex14.c @@ -19,7 +19,7 @@ static void * worker (void *arg) { void *result = NULL; - int nr = (int) arg; + int nr = (long int) arg; int i; for (i = 0; i < ROUNDS; ++i) @@ -110,7 +110,7 @@ do_test (void) /* Start the threads. */ for (i = 0; i < NTHREADS; ++i) - if (pthread_create (&threads[i], NULL, worker, (void *) i) != 0) + if (pthread_create (&threads[i], NULL, worker, (void *) (long int) i) != 0) { printf ("Failed to start thread %d\n", i); exit (1); diff --git a/linuxthreads/Examples/ex3.c b/linuxthreads/Examples/ex3.c index 8005200eff..b80b323a33 100644 --- a/linuxthreads/Examples/ex3.c +++ b/linuxthreads/Examples/ex3.c @@ -35,7 +35,7 @@ int main(int argc, char ** argv) /* Create the searching threads */ for (started=0; started %p\n", size, buf); + printf ("malloc (%zu) => %p\n", size, buf); return buf; } diff --git a/malloc/tst-valloc.c b/malloc/tst-valloc.c index 7958d51822..643a0dda4a 100644 --- a/malloc/tst-valloc.c +++ b/malloc/tst-valloc.c @@ -3,19 +3,21 @@ #include #include -int main(void) +int +main (void) { char *p; int pagesize = getpagesize (); int i; p = valloc (pagesize); - i = (int) p; + i = (long int) p; - if ((i & (pagesize-1)) != 0) { - fprintf (stderr, "Alignment problem: valloc returns %p\n", p); - exit(1); - } + if ((i & (pagesize-1)) != 0) + { + fprintf (stderr, "Alignment problem: valloc returns %p\n", p); + exit (1); + } return 0; } diff --git a/math/test-fpucw.c b/math/test-fpucw.c index 0294a42bb5..d5706f1f66 100644 --- a/math/test-fpucw.c +++ b/math/test-fpucw.c @@ -32,8 +32,8 @@ main (void) cw &= ~_FPU_RESERVED; if (cw != (_FPU_DEFAULT & ~_FPU_RESERVED)) - printf ("control word is 0x%x but should be 0x%x.\n", - cw, (_FPU_DEFAULT & ~_FPU_RESERVED)); + printf ("control word is 0x%lx but should be 0x%lx.\n", + (long int) cw, (long int) (_FPU_DEFAULT & ~_FPU_RESERVED)); return cw != (_FPU_DEFAULT & ~_FPU_RESERVED); diff --git a/nscd/nscd.h b/nscd/nscd.h index ab93a9ac3e..b2d438d550 100644 --- a/nscd/nscd.h +++ b/nscd/nscd.h @@ -102,7 +102,7 @@ extern const char *server_user; /* Prototypes for global functions. */ /* nscd.c */ -extern void termination_handler (int signum); +extern void termination_handler (int signum) __attribute__ ((__noreturn__)); extern int nscd_open_socket (void); /* connections.c */ @@ -115,7 +115,7 @@ extern int nscd_parse_file (const char *fname, struct database dbs[lastdb]); /* nscd_stat.c */ extern void send_stats (int fd, struct database dbs[lastdb]); -extern int receive_print_stats (void); +extern int receive_print_stats (void) __attribute__ ((__noreturn__)); /* cache.c */ extern struct hashentry *cache_search (int type, void *key, size_t len, diff --git a/stdio-common/tst-fmemopen.c b/stdio-common/tst-fmemopen.c index f22ebd52fe..84ded4f599 100644 --- a/stdio-common/tst-fmemopen.c +++ b/stdio-common/tst-fmemopen.c @@ -34,7 +34,7 @@ main (void) fputc (ch, stdout); if (ch != *cp) { - printf ("\ncharacter %d: '%c' instead of '%c'\n", + printf ("\ncharacter %td: '%c' instead of '%c'\n", cp - blah, ch, *cp); exit (1); } @@ -79,7 +79,7 @@ main (void) fputc (ch, stdout); if (ch != *cp) { - printf ("%d character: '%c' instead of '%c'\n", + printf ("%td character: '%c' instead of '%c'\n", cp - blah, ch, *cp); exit (1); } diff --git a/stdlib/tst-strtol.c b/stdlib/tst-strtol.c index d4ab95e1db..ae8fdd4905 100644 --- a/stdlib/tst-strtol.c +++ b/stdlib/tst-strtol.c @@ -70,8 +70,8 @@ static const struct ltest tests[] = {"922337203685477580777", 9223372036854775807, 0, 0, ERANGE}, {"9223372036854775810", 9223372036854775807, 0, 0, ERANGE}, {"-2147483648", -2147483648, 0, 0, 0}, - {"-9223372036854775808", -9223372036854775808, 0, 0, 0}, - {"-9223372036854775809", -9223372036854775808, 0, 0, ERANGE}, + {"-9223372036854775808", 0x8000000000000000, 0, 0, 0}, + {"-9223372036854775809", 0x8000000000000000, 0, 0, ERANGE}, {"0x112233445566778899z", 9223372036854775807, 16, 'z', ERANGE}, {"0xFFFFFFFFFFFF00FF" , 9223372036854775807, 0, 0, ERANGE}, #endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/types.h b/sysdeps/unix/sysv/linux/sparc/bits/types.h index 0cfd271e9b..a7de62eb15 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/types.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/types.h @@ -81,7 +81,7 @@ typedef __quad_t __off64_t; /* "" (LFS) */ typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ typedef int __pid_t; /* Type of process identifications. */ #if __WORDSIZE == 64 -typedef long long int __ssize_t; /* Type of a byte count, or error. */ +typedef long int __ssize_t; /* Type of a byte count, or error. */ #else typedef int __ssize_t; /* Type of a byte count, or error. */ #endif