]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Tue, 3 Nov 2009 06:41:31 +0000 (07:41 +0100)
committerSimon Josefsson <simon@josefsson.org>
Tue, 3 Nov 2009 06:41:31 +0000 (07:41 +0100)
55 files changed:
build-aux/pmccabe2html
build-aux/useless-if-before-free
gl/m4/fseeko.m4
gl/m4/gnulib-comp.m4
gl/m4/inet_ntop.m4
gl/m4/inet_pton.m4
gl/m4/pmccabe2html.m4 [deleted file]
gl/m4/ungetc.m4
gl/sockets.c
gl/stdio.in.h
gl/sys_stat.in.h
gl/tests/test-arpa_inet.c
gl/tests/test-getaddrinfo.c
gl/tests/test-getdelim.c
gl/tests/test-getline.c
gl/tests/test-gettimeofday.c
gl/tests/test-memchr.c
gl/tests/test-netinet_in.c
gl/tests/test-select-stdin.c
gl/tests/test-select.c
gl/tests/test-sockets.c
gl/tests/test-stddef.c
gl/tests/test-stdint.c
gl/tests/test-stdio.c
gl/tests/test-stdlib.c
gl/tests/test-strerror.c
gl/tests/test-string.c
gl/tests/test-sys_select.c
gl/tests/test-sys_socket.c
gl/tests/test-sys_stat.c
gl/tests/test-sys_time.c
gl/tests/test-time.c
gl/tests/test-unistd.c
gl/tests/test-version-etc.c
gl/tests/test-wchar.c
lib/gl/m4/fseeko.m4
lib/gl/m4/ungetc.m4
lib/gl/sockets.c
lib/gl/stdio.in.h
lib/gl/sys_stat.in.h
lib/gl/tests/test-memchr.c
lib/gl/tests/test-sockets.c
lib/gl/tests/test-stddef.c
lib/gl/tests/test-stdint.c
lib/gl/tests/test-stdio.c
lib/gl/tests/test-stdlib.c
lib/gl/tests/test-string.c
lib/gl/tests/test-strverscmp.c
lib/gl/tests/test-sys_socket.c
lib/gl/tests/test-sys_stat.c
lib/gl/tests/test-time.c
lib/gl/tests/test-unistd.c
lib/gl/tests/test-wchar.c
libextra/gl/md5.c
maint.mk

index 27bb8f35394f5f7e58c1caa871bef0205b8cd3ab..bc0f6e80b9767561e245726ccff9ea6d64024a57 100755 (executable)
@@ -1,7 +1,8 @@
-#!/usr/bin/awk -f
+#!/bin/sh
+exec awk -f "$0" "$@"
 # pmccabe2html - pmccabe to html converter
 
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 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
index abcdef2cda289b36f696324883b2cd899978eac8..793c9753e05f1f0ab7841582cef49287e8788f5c 100755 (executable)
@@ -1,4 +1,6 @@
-#!/usr/bin/perl -T
+eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
+  & eval 'exec perl -wST "$0" $argv:q'
+    if 0;
 # Detect instances of "if (p) free (p);".
 # Likewise for "if (p != NULL) free (p);".  And with braces.
 # Also detect "if (NULL != p) free (p);".
@@ -197,6 +199,7 @@ When modifying files, refuse to process anything other than a regular file.
 EOF
 
 ## Local Variables:
+## mode: perl
 ## indent-tabs-mode: nil
 ## eval: (add-hook 'write-file-hooks 'time-stamp)
 ## time-stamp-start: "my $VERSION = '"
index 3d773656886d4f9811ee80be0fe07a37f347a9c9..a370648e9f3411b3c72700c1d2bd8ea1029b4677 100644 (file)
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 4
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# fseeko.m4 serial 6
+dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,8 @@ AC_DEFUN([gl_FUNC_FSEEKO],
 
   AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
     [
-      AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [fseeko (stdin, 0, 0);])],
        [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
   if test $gl_cv_func_fseeko = no; then
@@ -31,4 +32,6 @@ AC_DEFUN([gl_REPLACE_FSEEKO],
   AC_LIBOBJ([fseeko])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   REPLACE_FSEEKO=1
+  dnl If we are also using the fseek module, then fseek needs replacing, too.
+  m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
 ])
index 045b826d02ec12484d14f78f991a142846af7661..669e6d8b1d3bd8eba3211ae5afa3b42001e5ed06 100644 (file)
@@ -124,7 +124,6 @@ AC_SUBST([LTALLOCA])
   AC_PROG_MKDIR_P
   gl_FUNC_PERROR
   gl_STRING_MODULE_INDICATOR([perror])
-  gl_PMCCABE2HTML
   AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
   AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
   gl_FUNC_READ_FILE
@@ -481,7 +480,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/netdb_h.m4
   m4/netinet_in_h.m4
   m4/perror.m4
-  m4/pmccabe2html.m4
   m4/printf.m4
   m4/read-file.m4
   m4/readline.m4
index 2bbdca10889797ecc5fbef4a315a5406b2c92f21..85a6bb6808b5bbc7f370136daf2b48e71a406ff9 100644 (file)
@@ -1,4 +1,4 @@
-# inet_ntop.m4 serial 9
+# inet_ntop.m4 serial 10
 dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,17 +11,17 @@ AC_DEFUN([gl_INET_NTOP],
 
   gl_REPLACE_ARPA_INET_H
 
-  dnl The AC_SEARCH_LIBS call is a hack to persuade the Solaris 8 linker to
-  dnl find inet_ntop.
-  dnl
-  dnl It is the responsibility of gl_INET_NTOP's caller to arrange for
-  dnl -lnsl if it is needed.  Normally -lnsl is not needed on Solaris 8,
-  dnl since inet_ntop is needed only by getaddrinfo, and getaddrinfo
-  dnl isn't built on Solaris 8.
+  dnl Most platforms that provide inet_ntop define it in libc.
+  dnl Solaris 8..10 provide inet_ntop in libnsl instead.
   gl_save_LIBS=$LIBS
   AC_SEARCH_LIBS([inet_ntop], [nsl], [],
     [AC_REPLACE_FUNCS([inet_ntop])])
   LIBS=$gl_save_LIBS
+  INET_NTOP_LIB=
+  if test "$ac_cv_search_inet_ntop" != "none needed"; then
+    INET_NTOP_LIB="$ac_cv_search_inet_ntop"
+  fi
+  AC_SUBST([INET_NTOP_LIB])
 
   gl_PREREQ_INET_NTOP
 ])
index e0ec432bc6e3e600608789f0d38162ee401e7004..f0718016a8ec4098a32015f9f239d315269eaa81 100644 (file)
@@ -1,4 +1,4 @@
-# inet_pton.m4 serial 7
+# inet_pton.m4 serial 8
 dnl Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,18 @@ AC_DEFUN([gl_INET_PTON],
 
   gl_REPLACE_ARPA_INET_H
 
-  AC_REPLACE_FUNCS([inet_pton])
+  dnl Most platforms that provide inet_pton define it in libc.
+  dnl Solaris 8..10 provide inet_pton in libnsl instead.
+  gl_save_LIBS=$LIBS
+  AC_SEARCH_LIBS([inet_pton], [nsl], [],
+    [AC_REPLACE_FUNCS([inet_pton])])
+  LIBS=$gl_save_LIBS
+  INET_PTON_LIB=
+  if test "$ac_cv_search_inet_pton" != "none needed"; then
+    INET_PTON_LIB="$ac_cv_search_inet_pton"
+  fi
+  AC_SUBST([INET_PTON_LIB])
+
   gl_PREREQ_INET_PTON
 ])
 
diff --git a/gl/m4/pmccabe2html.m4 b/gl/m4/pmccabe2html.m4
deleted file mode 100644 (file)
index 2985f7c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# pmccabe2html.m4 serial 2
-dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Simon Josefsson
-
-# Usage: gl_PMCCABE2HTML([]).
-AC_DEFUN([gl_PMCCABE2HTML],
-[
-  AC_REQUIRE([AC_PROG_AWK])
-  AC_PATH_PROG([PMCCABE], [pmccabe], [false])
-])
index 9236d4c8367337b035081a3362ab89c2232a6596..eb652356b539a9f45a9903728470834138bc4b54 100644 (file)
@@ -1,4 +1,4 @@
-# ungetc.m4 serial 1
+# ungetc.m4 serial 2
 dnl Copyright (C) 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
     [gl_cv_func_ungetc_works],
     [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-      ]], [FILE *f; long l;
+      ]], [FILE *f;
           if (!(f = fopen ("conftest.tmp", "w+"))) return 1;
           if (fputs ("abc", f) < 0) return 2;
           rewind (f);
index 7cb9981d120a8503f9e6dfefe53e7d6c6c091153..cb169f8864b7ab6bcdec16a74a738ff7da915fc5 100644 (file)
 #if WINDOWS_SOCKETS
 
 /* This includes winsock2.h on MinGW. */
-#include <sys/socket.h>
+# include <sys/socket.h>
 
-#include "close-hook.h"
+# include "close-hook.h"
 
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
+# include "w32sock.h"
 
 static int
 close_fd_maybe_socket (int fd, const struct close_hook *remaining_list)
@@ -71,10 +71,10 @@ static struct close_hook close_sockets_hook;
 
 static int initialized_sockets_version /* = 0 */;
 
-#endif
+#endif /* WINDOWS_SOCKETS */
 
 int
-gl_sockets_startup (int version)
+gl_sockets_startup (int version _UNUSED_PARAMETER_)
 {
 #if WINDOWS_SOCKETS
   if (version > initialized_sockets_version)
index 5002acc6d21624eb4668e254446ec6c1ee6e5a1a..ee53703826c8163ffeef09737640995306c43518 100644 (file)
@@ -227,7 +227,14 @@ extern int rpl_fseek (FILE *fp, long offset, int whence);
    fflush(), and which detect pipes.  */
 #  define fseeko rpl_fseeko
 extern int fseeko (FILE *fp, off_t offset, int whence);
-#  define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
+#  if !@GNULIB_FSEEK@
+#   undef fseek
+#   define fseek(f,o,w) \
+     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use fseeko function for handling of large files"), \
+      fseeko (f, o, w))
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fseeko
@@ -263,7 +270,14 @@ extern long rpl_ftell (FILE *fp);
 # if @REPLACE_FTELLO@
 #  define ftello rpl_ftello
 extern off_t ftello (FILE *fp);
-#  define ftell(fp) ftello (fp)
+#  if !@GNULIB_FTELL@
+#   undef ftell
+#   define ftell(f) \
+     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use ftello function for handling of large files"), \
+      ftello (f))
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef ftello
index 875f0644de8c8bc370316a383c962670131782ea..98b3689f780789f06aab58490aa2fd7289bd99c0 100644 (file)
@@ -456,7 +456,15 @@ int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
    struct stat.  This means that rpl_stat will not be used if the user
    does (stat)(a,b).  Oh well.  */
 #  undef stat
-#  define stat(name, st) rpl_stat (name, st)
+#  ifdef _LARGE_FILES
+    /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+       so we have to replace stat64() instead of stat(). */
+#   define stat stat64
+#   undef stat64
+#   define stat64(name, st) rpl_stat (name, st)
+#  else /* !_LARGE_FILES */
+#   define stat(name, st) rpl_stat (name, st)
+#  endif /* !_LARGE_FILES */
 extern int stat (const char *name, struct stat *buf);
 # endif
 #elif defined GNULIB_POSIXCHECK
index fc2d8ba448622498106259b554db9039bb38f48d..1e2479f4f91bad2bbbf1ea1746344bca98879753 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -21,7 +21,7 @@
 #include <arpa/inet.h>
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index eeea3f7c432b8d7d8d6540323432b933ddf359c3..384b98b6e8f01b8b2379f40d12d4c400db9853e4 100644 (file)
@@ -44,7 +44,8 @@
 # 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;
index 0c112f6bd5e4af61dbafea9c7435fc6a73bd1dcf..da4fe6b313005317b0475122782efb62e89e6b33 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -36,7 +36,7 @@
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   FILE *f;
   char *line = NULL;
index 51fc8168660fa1fedec513e8c829202f37a42c75..50722cd48d5aa3309419f665321e2b3baf134aaa 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -36,7 +36,7 @@
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   FILE *f;
   char *line = NULL;
index 892b18829c96d1b6cc90ff2234d923d156f40faf..3b858791a42173d4caa8df909bce503e1dfa4589 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007 Free Software Foundation
+ * Copyright (C) 2005, 2007, 2009 Free Software Foundation
  * Written by Jim Meyering.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 #include <string.h>
 
 int
-main (int argc, char *argv[])
+main (void)
 {
   time_t t = 0;
   struct tm *lt;
index 1124f8b5871362e1bec3f5d8b6bbd0fa6446b581..d5e53e0081b1ae57b85157777840f25a11bad6e5 100644 (file)
@@ -41,7 +41,7 @@
 #define MEMCHR (char *) memchr
 
 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n);
@@ -102,8 +102,6 @@ main ()
 
     if (page_boundary != NULL)
       {
-       int n;
-
        for (n = 1; n <= 500; n++)
          {
            char *mem = page_boundary - n;
@@ -111,7 +109,7 @@ main ()
            ASSERT (MEMCHR (mem, 'U', n) == NULL);
 
            {
-             int i;
+             size_t i;
 
              for (i = 0; i < n; i++)
                {
index b1957197b714e64b7ace02e5e9ba4e518db9da4b..5a61557c94ec02b72d642eef43625f6459a65e2e 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -21,7 +21,7 @@
 #include <netinet/in.h>
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index e855f92d20dc28b53b018c347965967e1c168796..079dec50e709d6a23d23c0eb70e1a29987023dfa 100644 (file)
@@ -1,5 +1,5 @@
 /* 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
@@ -25,7 +25,7 @@
 #include <unistd.h>
 
 int
-main ()
+main (void)
 {
   printf ("Applying select() from standard input. Press Ctrl-C to abort.\n");
   for (;;)
index ec822501494036cbb4aa8712b81b3a7c6c8131f7..d6d6b063aca6311bcfdb714cd1bff2d188d4cc26 100644 (file)
@@ -84,7 +84,7 @@ test (void (*fn) (void), const char *msg)
 /* Funny socket code.  */
 
 static int
-open_server_socket ()
+open_server_socket (void)
 {
   int s, x;
   struct sockaddr_in ia;
@@ -355,7 +355,7 @@ test_pipe (void)
 /* Do them all.  */
 
 int
-main ()
+main (void)
 {
   int result;
 
index 3c85a431c5ba85a9ea2d61d511ddc5625a319054..2d259649cdf79ba3ef921064a966b7827f0bad7a 100644 (file)
@@ -22,7 +22,7 @@
 #include "sockets.h"
 
 int
-main (int argc, char *argv[])
+main (void)
 {
   int err;
 
index f8484987cb3f432009010114e2c3968dd63008cb..c0a7515ecca1dfe0732bc7932ac2bed89724d0af 100644 (file)
@@ -32,7 +32,7 @@ size_t c = 2;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index a2bf42ac899451eabcbe4dcf041c726951841a7d..4e9b3621eeb3829d372c7cf8bbdacbb77a2f2249 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
@@ -354,7 +354,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
 
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index dcfe38dd515cf365fc8c55fbf19ed17177fa23d5..3f2f0677f0c7db62b28579e246d80d552ca36bad 100644 (file)
@@ -30,7 +30,7 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index ae46ba16625479aeb9022489162bee441a57433b..fad5cf450e58bf42c1651dda278c752944e56a09 100644 (file)
@@ -29,7 +29,7 @@ int exitcode;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   /* Check that some macros are defined and different integer constants.  */
   switch (exitcode)
index 3d9814d5d4c8c4ea08af1b757341106ab8f14dde..27eb969a7023ff54fd6f1d75d028729e91a80edb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of strerror() 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
@@ -37,7 +37,7 @@
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   char *str;
 
index fe53cd9b152a584e9559ff43b55a38106416dcad..69df747eb675b6d820019029b2394cc6a42a3c6c 100644 (file)
@@ -27,7 +27,7 @@
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 66079529ef6b6e758825ed8e378c3993ac422607..aef8941071a79e50aa9c85b08ef8122925fdda02 100644 (file)
@@ -24,7 +24,7 @@
 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'".  */
index 3d946a83bfc1050bede3fa44275487df83aad97a..ddb491b312df757340e87496000783fb12c0a278 100644 (file)
@@ -28,7 +28,7 @@ int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
 #endif
 
 int
-main ()
+main (void)
 {
   struct sockaddr_storage x;
   sa_family_t i;
index a73f9b81c61f608148275059b644ec0477439de7..4a85c9f08b48f08899cf4848981551369b21d641 100644 (file)
@@ -282,7 +282,7 @@ nlink_t t1;
 struct timespec t2;
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index bae4108e0771f49b490c62755b2dae4f8d5817ac..74f35acfe41c2d6be77a768730fce0ec150b572a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/time.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
@@ -23,7 +23,7 @@
 struct timeval a;
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index ea8143737f16cd0099831f868966accabcc4cee4..4afa3b39881abaef3203ce5950a9583aeeb8a013 100644 (file)
@@ -29,7 +29,7 @@ struct timespec a;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 129367b4d7df989e1f31d1035e9ddc444d8a3169..dd907f4ebe9d4c227de732efcf2aae611df87930 100644 (file)
@@ -50,7 +50,7 @@ intptr_t t8;
 #endif
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 71cbc8bac4583aa9714c511549f62fa8f1fd4335..9ff97c45a8b12c22fdc61f277a18a4164faf1e52 100644 (file)
@@ -24,7 +24,7 @@
 #define AUTHORS "Sergey Poznyakoff", "Eric Blake"
 
 int
-main (int argc, char **argv)
+main (int argc _UNUSED_PARAMETER_, char **argv)
 {
   set_program_name (argv[0]);
   version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
index 28660688d2cf6fb2449a66509ddff9968da31bdd..2e60bb86db298b13e4dd656028ea8460a009fe1a 100644 (file)
@@ -31,7 +31,7 @@ wint_t b = 'x';
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 3d773656886d4f9811ee80be0fe07a37f347a9c9..a370648e9f3411b3c72700c1d2bd8ea1029b4677 100644 (file)
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 4
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# fseeko.m4 serial 6
+dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -15,7 +15,8 @@ AC_DEFUN([gl_FUNC_FSEEKO],
 
   AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
     [
-      AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
+]], [fseeko (stdin, 0, 0);])],
        [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
   if test $gl_cv_func_fseeko = no; then
@@ -31,4 +32,6 @@ AC_DEFUN([gl_REPLACE_FSEEKO],
   AC_LIBOBJ([fseeko])
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   REPLACE_FSEEKO=1
+  dnl If we are also using the fseek module, then fseek needs replacing, too.
+  m4_ifdef([gl_REPLACE_FSEEK], [gl_REPLACE_FSEEK])
 ])
index 9236d4c8367337b035081a3362ab89c2232a6596..eb652356b539a9f45a9903728470834138bc4b54 100644 (file)
@@ -1,4 +1,4 @@
-# ungetc.m4 serial 1
+# ungetc.m4 serial 2
 dnl Copyright (C) 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
     [gl_cv_func_ungetc_works],
     [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-      ]], [FILE *f; long l;
+      ]], [FILE *f;
           if (!(f = fopen ("conftest.tmp", "w+"))) return 1;
           if (fputs ("abc", f) < 0) return 2;
           rewind (f);
index f0bf0acfb4a61d5b1f057c3a22984a315dd04599..a6bbf03c9ede176b839bb40e4ea1b1f8471c2f67 100644 (file)
 #if WINDOWS_SOCKETS
 
 /* This includes winsock2.h on MinGW. */
-#include <sys/socket.h>
+# include <sys/socket.h>
 
-#include "close-hook.h"
+# include "close-hook.h"
 
 /* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
+# include "w32sock.h"
 
 static int
 close_fd_maybe_socket (int fd, const struct close_hook *remaining_list)
@@ -71,10 +71,10 @@ static struct close_hook close_sockets_hook;
 
 static int initialized_sockets_version /* = 0 */;
 
-#endif
+#endif /* WINDOWS_SOCKETS */
 
 int
-gl_sockets_startup (int version)
+gl_sockets_startup (int version _UNUSED_PARAMETER_)
 {
 #if WINDOWS_SOCKETS
   if (version > initialized_sockets_version)
index 384010a456b20577eb966b0760a79d13859332e4..cd11a52a9193ceab58d3e2625947afab2d4f6671 100644 (file)
@@ -227,7 +227,14 @@ extern int rpl_fseek (FILE *fp, long offset, int whence);
    fflush(), and which detect pipes.  */
 #  define fseeko rpl_fseeko
 extern int fseeko (FILE *fp, off_t offset, int whence);
-#  define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
+#  if !@GNULIB_FSEEK@
+#   undef fseek
+#   define fseek(f,o,w) \
+     (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use fseeko function for handling of large files"), \
+      fseeko (f, o, w))
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef fseeko
@@ -263,7 +270,14 @@ extern long rpl_ftell (FILE *fp);
 # if @REPLACE_FTELLO@
 #  define ftello rpl_ftello
 extern off_t ftello (FILE *fp);
-#  define ftell(fp) ftello (fp)
+#  if !@GNULIB_FTELL@
+#   undef ftell
+#   define ftell(f) \
+     (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
+                       "on 32-bit platforms - " \
+                       "use ftello function for handling of large files"), \
+      ftello (f))
+#  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef ftello
index 13cfcbf592904f7bfcb465fcf954778945a2844a..1afd5c9792df955f4908fd8124fc77675f5846e9 100644 (file)
@@ -456,7 +456,15 @@ int mknodat (int fd, char const *file, mode_t mode, dev_t dev);
    struct stat.  This means that rpl_stat will not be used if the user
    does (stat)(a,b).  Oh well.  */
 #  undef stat
-#  define stat(name, st) rpl_stat (name, st)
+#  ifdef _LARGE_FILES
+    /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+       so we have to replace stat64() instead of stat(). */
+#   define stat stat64
+#   undef stat64
+#   define stat64(name, st) rpl_stat (name, st)
+#  else /* !_LARGE_FILES */
+#   define stat(name, st) rpl_stat (name, st)
+#  endif /* !_LARGE_FILES */
 extern int stat (const char *name, struct stat *buf);
 # endif
 #elif defined GNULIB_POSIXCHECK
index 1124f8b5871362e1bec3f5d8b6bbd0fa6446b581..d5e53e0081b1ae57b85157777840f25a11bad6e5 100644 (file)
@@ -41,7 +41,7 @@
 #define MEMCHR (char *) memchr
 
 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n);
@@ -102,8 +102,6 @@ main ()
 
     if (page_boundary != NULL)
       {
-       int n;
-
        for (n = 1; n <= 500; n++)
          {
            char *mem = page_boundary - n;
@@ -111,7 +109,7 @@ main ()
            ASSERT (MEMCHR (mem, 'U', n) == NULL);
 
            {
-             int i;
+             size_t i;
 
              for (i = 0; i < n; i++)
                {
index 3c85a431c5ba85a9ea2d61d511ddc5625a319054..2d259649cdf79ba3ef921064a966b7827f0bad7a 100644 (file)
@@ -22,7 +22,7 @@
 #include "sockets.h"
 
 int
-main (int argc, char *argv[])
+main (void)
 {
   int err;
 
index f8484987cb3f432009010114e2c3968dd63008cb..c0a7515ecca1dfe0732bc7932ac2bed89724d0af 100644 (file)
@@ -32,7 +32,7 @@ size_t c = 2;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index a2bf42ac899451eabcbe4dcf041c726951841a7d..4e9b3621eeb3829d372c7cf8bbdacbb77a2f2249 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2008 Free Software Foundation, Inc.
+   Copyright (C) 2006-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
@@ -354,7 +354,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
 
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index dcfe38dd515cf365fc8c55fbf19ed17177fa23d5..3f2f0677f0c7db62b28579e246d80d552ca36bad 100644 (file)
@@ -30,7 +30,7 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index ae46ba16625479aeb9022489162bee441a57433b..fad5cf450e58bf42c1651dda278c752944e56a09 100644 (file)
@@ -29,7 +29,7 @@ int exitcode;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   /* Check that some macros are defined and different integer constants.  */
   switch (exitcode)
index fe53cd9b152a584e9559ff43b55a38106416dcad..69df747eb675b6d820019029b2394cc6a42a3c6c 100644 (file)
@@ -27,7 +27,7 @@
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 04da20c105d7e7cf42ebf0f3c5fd27e95ca5d93e..a98695baa0cc4c4191d8882d68d301583c5aeeba 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of strverscmp() 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
@@ -37,7 +37,7 @@
   while (0)
 
 int
-main (int argc, char **argv)
+main (void)
 {
   ASSERT (strverscmp ("", "") == 0);
   ASSERT (strverscmp ("a", "a") == 0);
index 3d946a83bfc1050bede3fa44275487df83aad97a..ddb491b312df757340e87496000783fb12c0a278 100644 (file)
@@ -28,7 +28,7 @@ int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
 #endif
 
 int
-main ()
+main (void)
 {
   struct sockaddr_storage x;
   sa_family_t i;
index a73f9b81c61f608148275059b644ec0477439de7..4a85c9f08b48f08899cf4848981551369b21d641 100644 (file)
@@ -282,7 +282,7 @@ nlink_t t1;
 struct timespec t2;
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index ea8143737f16cd0099831f868966accabcc4cee4..4afa3b39881abaef3203ce5950a9583aeeb8a013 100644 (file)
@@ -29,7 +29,7 @@ struct timespec a;
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 129367b4d7df989e1f31d1035e9ddc444d8a3169..dd907f4ebe9d4c227de732efcf2aae611df87930 100644 (file)
@@ -50,7 +50,7 @@ intptr_t t8;
 #endif
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 28660688d2cf6fb2449a66509ddff9968da31bdd..2e60bb86db298b13e4dd656028ea8460a009fe1a 100644 (file)
@@ -31,7 +31,7 @@ wint_t b = 'x';
 verify (sizeof NULL == sizeof (void *));
 
 int
-main ()
+main (void)
 {
   return 0;
 }
index 07e7e927bc422f19b89836729cf3b92931d6fe85..0905367bdd7f48b0d8896de98f53e0d54208701c 100644 (file)
@@ -56,7 +56,7 @@
 # define SWAP(n) (n)
 #endif
 
-#define BLOCKSIZE 4096
+#define BLOCKSIZE 32768
 #if BLOCKSIZE % 64 != 0
 # error "invalid BLOCKSIZE"
 #endif
@@ -138,9 +138,12 @@ int
 md5_stream (FILE *stream, void *resblock)
 {
   struct md5_ctx ctx;
-  char buffer[BLOCKSIZE + 72];
   size_t sum;
 
+  char *buffer = malloc (BLOCKSIZE + 72);
+  if (!buffer)
+    return 1;
+
   /* Initialize the computation context.  */
   md5_init_ctx (&ctx);
 
@@ -169,7 +172,10 @@ md5_stream (FILE *stream, void *resblock)
                 exit the loop after a partial read due to e.g., EAGAIN
                 or EWOULDBLOCK.  */
              if (ferror (stream))
-               return 1;
+               {
+                 free (buffer);
+                 return 1;
+               }
              goto process_partial_block;
            }
 
@@ -194,6 +200,7 @@ process_partial_block:
 
   /* Construct result in desired memory.  */
   md5_finish_ctx (&ctx, resblock);
+  free (buffer);
   return 0;
 }
 #endif
index 68bd8f9153719b21b912d7f6e3121d598f37f067..996344a93d8349dc4c9d22e0990d953cb4062029 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -156,6 +156,12 @@ sc_prohibit_strcmp:
          { echo '$(ME): use STREQ in place of the above uses of str''cmp' \
                1>&2; exit 1; } || :
 
+# Pass EXIT_*, not number, to usage, exit, and error (when exiting)
+sc_prohibit_magic_number_exit:
+       @re='\<(usage|exit) ?\([0-9]|\<error ?\([1-9][0-9]*,'           \
+       msg='use EXIT_* values rather than magic number'                \
+         $(_prohibit_regexp)
+
 # Using EXIT_SUCCESS as the first argument to error is misleading,
 # since when that parameter is 0, error does not exit.  Use `0' instead.
 sc_error_exit_success: