+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.
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. */
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");
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;
}
+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
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");
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");
worker (void *arg)
{
void *result = NULL;
- int nr = (int) arg;
+ int nr = (long int) arg;
int i;
for (i = 0; i < ROUNDS; ++i)
/* 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);
/* 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++)
void *search(void *arg)
{
- int num = (int) arg;
+ int num = (long int) arg;
int i, j, ntries;
pthread_t tid;
pthread_join (th, &res);
- return (int) res;
+ return (int) (long int) res;
}
if (status == 0)
status = var != (PREPARE_BIT | PARENT_BIT);
- return (void *) status;
+ return (void *) (long int) status;
}
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)
/* 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;
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);
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;
}
#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;
}
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);
/* 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 */
/* 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,
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);
}
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);
}
{"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
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