aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog22
-rw-r--r--elf/ldconfig.c10
-rw-r--r--iconvdata/bug-iconv2.c2
-rw-r--r--io/test-lfs.c4
-rw-r--r--linuxthreads/ChangeLog10
-rw-r--r--linuxthreads/Examples/ex11.c6
-rw-r--r--linuxthreads/Examples/ex14.c4
-rw-r--r--linuxthreads/Examples/ex3.c4
-rw-r--r--linuxthreads/Examples/ex8.c4
-rw-r--r--linuxthreads/ecmutex.c6
-rw-r--r--malloc/tst-obstack.c2
-rw-r--r--malloc/tst-valloc.c14
-rw-r--r--math/test-fpucw.c4
-rw-r--r--nscd/nscd.h4
-rw-r--r--stdio-common/tst-fmemopen.c4
-rw-r--r--stdlib/tst-strtol.c4
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/types.h2
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 <jakub@redhat.com>
+
+ * 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 <aj@suse.de>
+
+ * 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 <drepper@redhat.com>
* 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 <jakub@redhat.com>
+
+ * 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 <bruce@cubik.org>
* 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<NUM_THREADS; started++)
- pthread_create(&threads[started], NULL, search, (void *)pid);
+ pthread_create(&threads[started], NULL, search, (void *) (long int) pid);
/* Wait for (join) all the searching threads */
for (i=0; i<NUM_THREADS; i++)
@@ -66,7 +66,7 @@ void print_it(void *arg)
void *search(void *arg)
{
- int num = (int) arg;
+ int num = (long int) arg;
int i, j, ntries;
pthread_t tid;
diff --git a/linuxthreads/Examples/ex8.c b/linuxthreads/Examples/ex8.c
index 1b9b335579..1976bfb0a3 100644
--- a/linuxthreads/Examples/ex8.c
+++ b/linuxthreads/Examples/ex8.c
@@ -68,7 +68,7 @@ main (void)
pthread_join (th, &res);
- return (int) res;
+ return (int) (long int) res;
}
@@ -97,5 +97,5 @@ thread (void *arg)
if (status == 0)
status = var != (PREPARE_BIT | PARENT_BIT);
- return (void *) status;
+ return (void *) (long int) status;
}
diff --git a/linuxthreads/ecmutex.c b/linuxthreads/ecmutex.c
index b9d1d54352..a47bd099c8 100644
--- a/linuxthreads/ecmutex.c
+++ b/linuxthreads/ecmutex.c
@@ -14,7 +14,7 @@ static pthread_mutex_t locks[] =
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
};
-#define nlocks (sizeof (locks) / sizeof (locks[0]))
+#define nlocks ((int) (sizeof (locks) / sizeof (locks[0])))
static pthread_barrier_t barrier;
#define SYNC pthread_barrier_wait (&barrier)
@@ -30,7 +30,7 @@ worker (void *arg)
/* We are locking the and unlocked the locks and check the errors.
Since we are using the error-checking variant the implementation
should report them. */
- int nr = (int) arg;
+ int nr = (long int) arg;
int i;
void *result = NULL;
int retval;
@@ -141,7 +141,7 @@ do_test (void)
pthread_barrier_init (&barrier, NULL, NTHREADS);
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 create thread %d: %m\n", i);
exit (1);
diff --git a/malloc/tst-obstack.c b/malloc/tst-obstack.c
index cd19431bb9..769697f185 100644
--- a/malloc/tst-obstack.c
+++ b/malloc/tst-obstack.c
@@ -14,7 +14,7 @@ static void *
verbose_malloc (size_t size)
{
void *buf = malloc (size);
- printf ("malloc (%u) => %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 <stdio.h>
#include <stdlib.h>
-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