Mostly Simon's modules; warnings reported by gcc 4.3.4 on coreutils.
* tests/test-getaddrinfo.c (simple): Mark static, and allow string
literals.
* tests/test-memchr.c (main): Avoid type mismatch.
* tests/test-arpa_inet.c (main): Avoid unused parameters.
* tests/test-base64.c (main): Likewise.
* tests/test-getdelim.c (main): Likewise.
* tests/test-gethostname.c (main): Likewise.
* tests/test-getline.c (main): Likewise.
* tests/test-netinet_in.c (main): Likewise.
* tests/test-select.c (open_server_socket, main): Likewise.
* tests/test-select-stdin.c (main): Likewise.
* tests/test-sockets.c (main): Likewise.
* tests/test-strsignal.c (main): Likewise.
* tests/test-sys_select.c (main): Likewise.
* tests/test-sys_socket.c (main): Likewise.
* tests/test-u64.c (main): Likewise.
* tests/test-xfprintf-posix.c (main): Likewise.
* tests/test-xvasprintf.c (test_xvasprintf, main): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-10-29 Eric Blake <ebb9@byu.net>
+ tests: avoid some compiler warnings
+ * tests/test-getaddrinfo.c (simple): Mark static, and allow string
+ literals.
+ * tests/test-memchr.c (main): Avoid type mismatch.
+ * tests/test-arpa_inet.c (main): Avoid unused parameters.
+ * tests/test-base64.c (main): Likewise.
+ * tests/test-getdelim.c (main): Likewise.
+ * tests/test-gethostname.c (main): Likewise.
+ * tests/test-getline.c (main): Likewise.
+ * tests/test-netinet_in.c (main): Likewise.
+ * tests/test-select.c (open_server_socket, main): Likewise.
+ * tests/test-select-stdin.c (main): Likewise.
+ * tests/test-sockets.c (main): Likewise.
+ * tests/test-strsignal.c (main): Likewise.
+ * tests/test-sys_select.c (main): Likewise.
+ * tests/test-sys_socket.c (main): Likewise.
+ * tests/test-u64.c (main): Likewise.
+ * tests/test-xfprintf-posix.c (main): Likewise.
+ * tests/test-xvasprintf.c (test_xvasprintf, main): Likewise.
+
sockets: avoid compiler warning
* lib/sockets.c (gl_sockets_startup): Mark unused parameter.
/* Test of <arpa/inet.h> substitute.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <arpa/inet.h>
int
-main ()
+main (void)
{
return 0;
}
/* Self tests for base64.
- Copyright (C) 2004, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software: you can redistribute it and/or modify
#include "base64.h"
int
-main (int argc, char *argv[])
+main (void)
{
const char *in = "abcdefghijklmnop";
const char *b64in = "YWJjZGVmZw==";
# define EAI_SERVICE 0
#endif
-int simple (char *host, char *service)
+static int
+simple (char const *host, char const *service)
{
char buf[BUFSIZ];
static int skip = 0;
/* Test of getdelim() function.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
while (0)
int
-main (int argc, char **argv)
+main (void)
{
FILE *f;
char *line = NULL;
#define NOHOSTNAME "magic-gnulib-test-string"
int
-main (int argc, char *argv[])
+main (int argc, char *argv[] _UNUSED_PARAMETER_)
{
char buf[HOST_NAME_MAX];
int rc;
/* Test of getline() function.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
while (0)
int
-main (int argc, char **argv)
+main (void)
{
FILE *f;
char *line = NULL;
ASSERT (MEMCHR (mem, 'U', n) == NULL);
{
- int i;
+ size_t i;
for (i = 0; i < n; i++)
{
/* Test of <netinet/in.h> substitute.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <netinet/in.h>
int
-main ()
+main (void)
{
return 0;
}
/* Test of select() substitute, reading from stdin.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <unistd.h>
int
-main ()
+main (void)
{
printf ("Applying select() from standard input. Press Ctrl-C to abort.\n");
for (;;)
/* Funny socket code. */
static int
-open_server_socket ()
+open_server_socket (void)
{
int s, x;
struct sockaddr_in ia;
/* Do them all. */
int
-main ()
+main (void)
{
int result;
#include "sockets.h"
int
-main (int argc, char *argv[])
+main (void)
{
int err;
/* Test of strsignal() function.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
int
-main (int argc, char **argv)
+main (void)
{
/* Work around bug in cygwin 1.5.25 <string.h> by declaring str as
const char *, even though strsignal is supposed to return char *.
struct timeval t1;
int
-main ()
+main (void)
{
/* Check that FD_ZERO can be used. This should not yield a warning
such as "warning: implicit declaration of function 'memset'". */
#endif
int
-main ()
+main (void)
{
struct sockaddr_storage x;
sa_family_t i;
#include <u64.h>
int
-main ()
+main (void)
{
u64 i = u64init (42, 4711);
u64 j, k, l;
/* Test of error-checking xfprintf() function with POSIX compatible formatting.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "test-fprintf-posix.h"
int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
{
set_program_name (argv[0]);
/* Test of xvasprintf() and xasprintf() functions.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
static void
-test_xvasprintf ()
+test_xvasprintf (void)
{
int repeat;
}
int
-main (int argc, char *argv[])
+main (int argc _UNUSED_PARAMETER_, char *argv[])
{
set_program_name (argv[0]);