I got a report about SIZE_MAX problems: In file included from ../gnutls_int.h:29, from opencdk.h:30, from kbnode.c:31: ../config.h:357:1: warning: "SIZE_MAX" redefined In file included from ./../gl/stdlib.h:52, from kbnode.c:28: ./../gl/stdint.h:473:1: warning: this is the location of the previous definition
Indeed, in gnulib we have a module 'size_max' that adds a definition of SIZE_MAX to config.h. The module 'stdint' that also adds a definition but to a stdint.h replacement. According to POSIX, it seems the definition belongs to stdint.h. The gettext and xsize modules are the only in gnulib that depends on size_max. The gettext module seems to need size_max just because it needs xsize. So if we fix the xsize module to not use size_max any more, as in the patch below, it seems as if the size_max module can go away. Bruno, what do you think about simply deprecating the size_max module? /Simon diff --git a/lib/xsize.h b/lib/xsize.h index 2d99a6b..87d8621 100644 --- a/lib/xsize.h +++ b/lib/xsize.h @@ -1,6 +1,6 @@ /* xsize.h -- Checked size_t computations. - Copyright (C) 2003, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 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 @@ -24,9 +24,7 @@ /* Get SIZE_MAX. */ #include <limits.h> -#if HAVE_STDINT_H -# include <stdint.h> -#endif +#include <stdint.h> /* The size of memory objects is often computed through expressions of type size_t. Example: diff --git a/m4/xsize.m4 b/m4/xsize.m4 index 631893c..9200f7a 100644 --- a/m4/xsize.m4 +++ b/m4/xsize.m4 @@ -1,5 +1,5 @@ -# xsize.m4 serial 4 -dnl Copyright (C) 2003-2004, 2008 Free Software Foundation, Inc. +# xsize.m4 serial 5 +dnl Copyright (C) 2003-2004, 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. @@ -7,7 +7,5 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. - AC_REQUIRE([gl_SIZE_MAX]) AC_REQUIRE([AC_C_INLINE]) - AC_CHECK_HEADERS([stdint.h]) ]) diff --git a/modules/gettext b/modules/gettext index 5278b40..872bad2 100644 --- a/modules/gettext +++ b/modules/gettext @@ -21,7 +21,6 @@ m4/nls.m4 m4/po.m4 m4/printf-posix.m4 m4/progtest.m4 -m4/size_max.m4 m4/stdint_h.m4 m4/threadlib.m4 m4/uintmax_t.m4 diff --git a/modules/size_max b/modules/size_max index df4b1bc..982ad4c 100644 --- a/modules/size_max +++ b/modules/size_max @@ -1,6 +1,12 @@ Description: Provide SIZE_MAX. +Status: +obsolete + +Notice: +This module is obsolete, use stdint instead. + Files: m4/size_max.m4 lib/size_max.h diff --git a/modules/xsize b/modules/xsize index edaf60f..b28f240 100644 --- a/modules/xsize +++ b/modules/xsize @@ -6,7 +6,7 @@ lib/xsize.h m4/xsize.m4 Depends-on: -size_max +stdint configure.ac: gl_XSIZE