* inet/test-ifaddrs.c: Fight warnings.
* argp/argp-help.c: Fight warnings.
* include/time.h: Declare __difftime.
2004-04-03 Ulrich Drepper <drepper@redhat.com>
+ * inet/test-ifaddrs.c: Fight warnings.
+
+ * argp/argp-help.c: Fight warnings.
+
+ * include/time.h: Declare __difftime.
+
* sysdeps/unix/sysv/linux/internal_statvfs.c: Restructure to avoid
duplication in 64-bit version.
* sysdeps/unix/sysv/linux/wordsize-64/internal_statvfs64.c: New file.
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
+#include <limits.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
#endif
hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
hol->short_options = malloc (num_short_options + 1);
- assert (hol->entries && hol->short_options
- && hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+ assert (hol->entries && hol->short_options);
+#if SIZE_MAX <= UINT_MAX
+ assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+#endif
/* Fill in the entries. */
so = hol->short_options;
char *short_options =
malloc (hol_so_len + strlen (more->short_options) + 1);
- assert (entries && short_options
- && num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+ assert (entries && short_options);
+#if SIZE_MAX <= UINT_MAX
+ assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
+#endif
__mempcpy (__mempcpy (entries, hol->entries,
hol->num_entries * sizeof (struct hol_entry)),
int era_cnt, __locale_t loc)
internal_function;
+extern double __difftime (time_t time1, time_t time0);
/* Use in the clock_* functions. Size of the field representing the
/* Test listing of network interface addresses.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004 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
#include <netinet/in.h>
#include <arpa/inet.h>
+static int failures;
+
+static const char *
+addr_string (struct sockaddr *sa, char *buf, size_t size)
+{
+ if (sa == NULL)
+ return "<none>";
+
+ switch (sa->sa_family)
+ {
+ case AF_INET:
+ return inet_ntop (AF_INET, &((struct sockaddr_in *) sa)->sin_addr,
+ buf, size);
+ case AF_INET6:
+ return inet_ntop (AF_INET6, &((struct sockaddr_in6 *) sa)->sin6_addr,
+ buf, size);
+#ifdef AF_LINK
+ case AF_LINK:
+ return "<link>";
+#endif
+ case AF_UNSPEC:
+ return "---";
+
+ case AF_PACKET:
+ return "<packet>";
+
+ default:
+ ++failures;
+ printf ("sa_family=%d %08x\n", sa->sa_family,
+ *(int*)&((struct sockaddr_in *) sa)->sin_addr.s_addr);
+ return "<unexpected sockaddr family>";
+ }
+}
+
+
int
main (void)
{
- int failures = 0;
struct ifaddrs *ifaces, *ifa;
if (getifaddrs (&ifaces) < 0)
for (ifa = ifaces; ifa != NULL; ifa = ifa->ifa_next)
{
char abuf[64], mbuf[64], dbuf[64];
- inline const char *addr_string (struct sockaddr *sa, char *buf)
- {
- if (sa == NULL)
- return "<none>";
-
- switch (sa->sa_family)
- {
- case AF_INET:
- return inet_ntop (AF_INET,
- &((struct sockaddr_in *) sa)->sin_addr,
- buf, sizeof abuf);
- case AF_INET6:
- return inet_ntop (AF_INET6,
- &((struct sockaddr_in6 *) sa)->sin6_addr,
- buf, sizeof abuf);
-#ifdef AF_LINK
- case AF_LINK:
- return "<link>";
-#endif
- case AF_UNSPEC:
- return "---";
-
- case AF_PACKET:
- return "<packet>";
-
- default:
- ++failures;
- printf ("sa_family=%d %08x\n", sa->sa_family,
- *(int*)&((struct sockaddr_in *) sa)->sin_addr.s_addr);
- return "<unexpected sockaddr family>";
- }
- }
printf ("%-15s%#.4x %-15s %-15s %-15s\n",
ifa->ifa_name, ifa->ifa_flags,
- addr_string (ifa->ifa_addr, abuf),
- addr_string (ifa->ifa_netmask, mbuf),
- addr_string (ifa->ifa_broadaddr, dbuf));
+ addr_string (ifa->ifa_addr, abuf, sizeof (abuf)),
+ addr_string (ifa->ifa_netmask, mbuf, sizeof (mbuf)),
+ addr_string (ifa->ifa_broadaddr, dbuf, sizeof (dbuf)));
}
freeifaddrs (ifaces);
#include <unistd.h>
+#if _POSIX_THREAD_CPUTIME
static pthread_barrier_t b2;
static pthread_barrier_t bN;
return NULL;
}
+#endif
int
pthread_t th[N + 1];
clockid_t cl[N + 1];
-#ifndef CLOCK_THREAD_CPUTIME_ID
+# ifndef CLOCK_THREAD_CPUTIME_ID
if (pthread_getcpuclockid (pthread_self (), &cl[0]) != 0)
{
puts ("own pthread_getcpuclockid failed");
return 1;
}
-#else
+# else
cl[0] = CLOCK_THREAD_CPUTIME_ID;
-#endif
+# endif
pthread_attr_t at;
/* Globally disable events.
- Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1999.
{
td_thragent_t *const ta = (td_thragent_t *) ta_arg;
td_err_e err;
- psaddr_t eventmask;
+ psaddr_t eventmask = 0;
void *copy;
LOG ("td_ta_clear_event");
/* Globally enable events.
- Copyright (C) 1999,2001,2002,2003 Free Software Foundation, Inc.
+ Copyright (C) 1999,2001,2002,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1999.
{
td_thragent_t *const ta = (td_thragent_t *) ta_arg;
td_err_e err;
- psaddr_t eventmask;
+ psaddr_t eventmask = 0;
void *copy;
LOG ("td_ta_set_event");
/* Iterate over a process's threads.
- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 1999.
{
td_thragent_t *const ta = (td_thragent_t *) ta_arg;
td_err_e err;
- psaddr_t list;
+ psaddr_t list = 0;
LOG ("td_ta_thr_iter");