lib/intprops.h


Log

Author Commit Date CI Message
Paul Eggert d41bb613 2017-05-25T00:08:09 intprops: port to recent icc Port to icc (ICC) 17.0.4 20170411, which defines __GNUC__ to be 5 but does not support __builtin_add_overflow etc. * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW) [__ICC]: Define to 0.
Paul Eggert d9c44b2b 2017-05-08T10:37:48 intprops: don’t depend on ‘verify’ Problem reported by Ævar Arnfjörð Bjarmason in: http://lists.gnu.org/archive/html/bug-gnulib/2017-05/msg00054.html * lib/intprops.h: Do not include verify.h, and move compile-time checks from here ... * tests/test-intprops.c (main): ... to here, if they’re not here already. Check widths of other standard integer types. * modules/intprops (Depends-on): Remove ‘verify’.
Paul Eggert 5ea3e3a1 2017-04-15T14:27:11 intprops: improve comments * lib/intprops.h: Improve and shorten commentary. For the record, if we ever run into a pedantic compiler that behaves differently from GCC when converting an out-of-range value to a signed integer, we can work around the problem with something like the following code, where UCT is the signed counterpart of T (UCT is sometimes narrower than UT) and all callers are changed accordingly: ((t) ((ut) (a) op (ut) (b))) (TYPE_MINIMUM (t) <= (uct) ((ut) (a) op (ut) (b)) \ ? ((t) (uct) (((ut) (a) op (ut) (b)) - TYPE_MINIMUM (t)) \ + TYPE_MINIMUM (t)) \ : (t) (uct) ((ut) (a) op (ut) (b)))
Paul Eggert f05e6ea8 2017-04-14T19:03:20 intprops: fix comment typo
Paul Eggert 749eb770 2017-04-14T18:55:42 intprops: try to avoid tickling similar bugs * lib/intprops.h (_GL_INT_OP_CALC): Document that UT no longer needs to be the same width as T; it can be wider. Change callers so that UT is at least as wide as unsigned int, as I suspect that this is less likely to run into compiler bugs.
Paul Eggert a49b6ecc 2017-04-14T17:38:58 intprops: port to Oracle Studio 12.3 x86 Problem reported by Gavin Smith in: http://lists.gnu.org/archive/html/bug-gnulib/2017-04/msg00049.html * lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): Convert unsigned to signed via the usual rather than the standard way, to avoid a compiler bug in Oracle Studio 12.3 x86.
Paul Eggert 04441fd8 2017-01-06T13:36:57 glob, intprops, xalloc: work around Clang bug Work around LLVM bug 16404, which is still not fixed. https://llvm.org/bugs/show_bug.cgi?id=16404 Problem reported by Nelson H. F. Beebe. * lib/glob.c, lib/intprops.h, lib/xalloc-oversized.h (__has_builtin): Remove. * lib/glob.c (size_add_wrapv): * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P): * lib/xalloc-oversized.h (xalloc_oversized): Do not use overflow builtins if Clang.
Paul Eggert a3fd683d 2017-01-01T02:59:23 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert 5833fd5d 2016-11-03T21:34:58 intprops: port to older XL C Problem reported by Alexander Samoilov in: http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00166.html http://savannah.nongnu.org/bugs/?49448 * lib/intprops.h (_GL_HAVE___TYPEOF__) [__IBM__TYPEOF__]: Define to 1 only for XL C 12.1 or later, since this bug occurs in XL C for AIX 6.0 but not in 12.1.
Paul Eggert 6625c98b 2016-09-13T21:49:10 intprops: new macro TYPE_WIDTH * lib/intprops.h (TYPE_WIDTH): New macro. (TYPE_MAXIMUM, _GL_SIGNED_INT_MAXIMUM, INT_STRLEN_BOUND): * lib/ftoastr.h (_GL_FLOAT_DIG_BITS_BOUND): * lib/parse-datetime.y (parse_datetime2): Use it.
Paul Eggert 39fca950 2016-08-30T12:29:21 intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6 * lib/intprops.h (INT_NEGATE_OVERFLOW): Tune for platforms like GCC 5 and 6 that have __builtin_sub_overflow but not __builtin_sub_overflow_p. With the recent changes, these platforms are a tiny bit faster with the INT_NEGATE_RANGE_OVERFLOW implementation than with INT_SUBTRACT_OVERFLOW implementation, since the former needs just one runtime comparison whereas the latter needs two.
Paul Eggert abae112b 2016-08-29T12:03:51 intprops.h: port recent changes to GCC 6.2.0 * lib/intprops.h (__has_builtin): Move earlier. (_GL_HAS_BUILTIN_OVERFLOW): Rename from _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL and don't worry about whether the last argument can be null. All uses changed. (_GL_HAS_BUILTIN_OVERFLOW_P): Also test __has_builtin. (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW): Don't try to use 3rd arg null, as this doesn't work on GCC 6.2.0 and it's not clear which GCC versions it works for. (_GL_INT_OP_WRAPV): Use _GL_HAS_BUILTIN_OVERFLOW instead of its definiens.
Paul Eggert d22721e2 2016-08-29T10:08:32 intprops.h: use __typeof__ with GCC 7 * lib/intprops.h (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW) (_GL_MULTIPLY_OVERFLOW): Use __typeof__ as in the GCC manual. This avoids computing the expression's value (which might overflow!).
Jim Meyering 175b4e22 2016-08-29T09:45:18 intprops.h, xalloc-oversized.h: work with gcc 7 In gcc 6, __builtin_add_overflow, __builtin_sub_overflow and __builtin_mul_overflow each accept a NULL pointer as the third argument. However in gcc 7, that is no longer accepted. Instead, one must use the "_p"-suffixed names, with which, the third parameter is no longer a pointer. * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL): Correct the definition: not true for gcc 7 and subsequent. (_GL_HAS_BUILTIN_OVERFLOW_P): Define. (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW): Provide new definitions for gcc 7 and subsequent. * lib/xalloc-oversized.h (xalloc_oversized): Provide a definition that works with gcc-7.
Jim Meyering b9c364f0 2016-08-29T09:27:50 intprops.h: fix missing-backslash problems * lib/intprops.h (_GL_ADD_OVERFLOW): Add backslash. (_GL_SUBTRACT_OVERFLOW,_GL_MULTIPLY_OVERFLOW): Likewise.
Paul Eggert f1012505 2016-08-24T22:24:48 intprops: fix paren typo on old platforms Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300#13 * lib/intprops.h (_GL_INT_OP_WRAPV_LONGISH) [__GNUC__ < 5 && !__has_builtin (__builtin_add_overflow) && (__STDC_VERSION__ < 201112 || _GL__GENERIC_BOGUS) && !defined LLONG_MAX]: Remove stray paren.
Paul Eggert a073adb9 2016-08-24T20:48:32 intprops: port to OpenVMS Problem reported by John E. Malmberg in: https://bugs.gnu.org/24300 * doc/posix-headers/limits.texi: Document the problem. * lib/intprops.h (LLONG_MAX, LLONG_MIN) [__INT64_MAX]: Define if not already defined.
Paul Eggert 406465c5 2016-06-24T13:35:12 intprops: port better to GCC 7 GCC 7 __builtin_add_overflow supports a new usage form, where the last argument is a null pointer, and which merely returns 1 if an overflow would occur. This is a constant expression if all arguments are constants, and should generate faster code when code needs to be generated. * lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_WITH_NULL): New macro. (_GL_ADD_OVERFLOW, _GL_SUBTRACT_OVERFLOW, _GL_MULTIPLY_OVERFLOW): Use builtin operations if available. (INT_NEGATE_OVERFLOW): Prefer INT_SUBTRACT_OVERFLOW if builtin operations are available, as it's almost surely faster.
Paul Eggert b9e3fb39 2016-04-13T10:49:08 intprops: check two's complement assumption Suggested by Eric Blake in: http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00016.html * lib/intprops.h: Include <verify.h>. Verify that signed char, short, int, long, and (if available) long long are two's complement. * modules/intprops (Depends-on): Add 'verify'.
Paul Eggert a4910b94 2016-04-13T00:06:36 intprops, mktime, strtol: assume two's complement These macros were not portable to every conforming C11 ones' complement platform. It's not worth the hassle of porting to some platforms that use ones' complement or signed magnitude, as such platforms are almost purely theoretical nowadays and porting even to some of them makes the code harder to review for little practical benefit. Problem reported by Florian Weimer in: https://sourceware.org/ml/libc-alpha/2016-04/msg00295.html * lib/intprops.h (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE, _GL_INT_TWOS_COMPLEMENT): * lib/mktime.c (TYPE_TWOS_COMPLEMENT): * lib/strtol.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT) (TYPE_SIGNED_MAGNITUDE): Remove. All uses rewritten to assume two's complement, which is all we can reasonably test nowadays anyway. * top/maint.mk (_intprops_names): Remove the removed macros.
Paul Eggert 841c4fa8 2016-03-08T16:35:58 intprops: make .h file license match module * lib/intprops.h: Change the license wording to match glibc format. This is what is in modules/intprops anyway. See: https://sourceware.org/bugzilla/show_bug.cgi?id=19738#c8
Paul Eggert 71090a2a 2016-01-01T00:56:19 version-etc: new year * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
Paul Eggert a2149646 2015-12-17T23:06:29 intprops: comment fix * lib/intprops.h: Fix comment. Reported by Pádraig Brady in: http://lists.gnu.org/archive/html/bug-gnulib/2015-12/msg00013.html
Paul Eggert f197c2c9 2015-11-10T12:31:38 intprops: new public macro EXPR_SIGNED Emacs can use this macro, so make it public. * doc/intprops.texi (Arithmetic Type Properties): Rename from 'Integer Type Determination', since some of these macros apply to non-integer types. Clarify what kinds of constant expressions these macros return. Say when the arguments can be non-integers. Mention newly published macro EXPR_SIGNED. * lib/intprops.h (EXPR_SIGNED): Rename from _GL_INT_SIGNED, to make it public. All uses changed.
Paul Eggert a66a3b96 2015-11-10T09:35:16 intprops: fix typo in clang port * lib/intprops.h (_GL_INT_OP_WRAPV): Fix misspelling of '__builtin_add_overflow' that is not caught by compiler.
Paul Eggert 8780c178 2015-11-04T08:27:57 intprops: revise _WRAPV macros, revert _OVERFLOW The incompatible changes to the _OVERFLOW macros were too much of a hassle in practice, so revert them. Instead, change the new _WRAPV macros to make them closer in behavior to GCC 5's new builtin_add_overflow etc. functions. No other software was using these newly-added macros yet, so this should be OK. * NEWS: Revert previous change, since the incompatible change has been reverted, and nobody used the incompatible version. * doc/intprops.texi (Wraparound Arithmetic, Integer Type Overflow): Document revised behavior. (Integer Range Overflow): Adjust example to match above revisions. * lib/intprops.h (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW) (INT_MULTIPLY_OVERFLOW): Revert previous change, so that these can be used in integer constant expressions again. (INT_CONST_ADD_OVERFLOW, INT_CONST_SUBTRACT_OVERFLOW) (INT_CONST_MULTIPLY_OVERFLOW): Remove, as these are no longer needed. (INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV) (INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV) (INT_REMAINDER_WRAPV, INT_LEFT_SHIFT_WRAPV): Remove, as they did not seem that useful. (INT_ADD_WRAPV, INT_SUBTRACT_WRAPV, INT_MULTIPLY_WRAPV) (_GL_INT_OP_WRAPV, _GL_INT_OP_WRAPV_LONGISH) (_GL_INT_OP_WRAPV_VIA_UNSIGNED): Support new semantics. (__has_builtin): New macro, if not alreay defined. (_GL__GENERIC_BOGUS, _GL_INT_OP_CALC, _GL_INT_OP_CALC1): New macros. * tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW) (INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW) (INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV) (INT_CONST_LEFT_SHIFT_WRAPV): Remove. (CHECK_SBINOP, CHECK_SSUM, CHECK_SUM1, CHECK_SSUM1) (CHECK_SDIFFERENCE, CHECK_SPRODUCT, CHECK_PRODUCT1, CHECK_SPRODUCT1): New macros. (CHECK_BINOP, CHECK_UNOP, main, CHECK_SUM): Test new behavior.
Jim Meyering 24fb386f 2015-11-03T08:32:27 intprops: add parentheses for when OP has precedence lower than "-" * lib/intprops.h (_GL_INT_OP_WRAPV_VIA_UNSIGNED): In "a OP b - c", "a OP b" must be parenthesized for when OP is like "<<", which has lower precedence than the following "-". Reported by Pádraig Brady.
Paul Eggert 86b1f082 2015-10-30T13:45:26 intprops: add WRAPV and const flavors for GCC 5 If available, use GCC 5's builtin functions for efficient integer overflow checking. Also, add macros like INT_ADD_WRAPV that efficently and safely compute the low-order bits of the correct answer. A downside of these efficient functions is that they cannot be used in constant expressions, so add macros like INT_CONST_ADD_OVERFLOW and INT_CONST_ADD_WRAPV that can be used even in constant expressions. * NEWS: Document the incompatible changes to INT_ADD_OVERFLOW etc. * doc/intprops.texi (Integer Properties, Integer Type Overflow): Document the changes. (Wraparound Arithmetic): New section. (Integer Range Overflow): Put this subsection last, since it's least useful. * lib/intprops.h (INT_CONST_ADD_OVERFLOW) (INT_CONST_SUBTRACT_OVERFLOW, INT_CONST_MULTIPLY_OVERFLOW): New macros, with the meaning that INT_ADD_OVERFLOW etc. used to have. (INT_CONST_ADD_WRAPV, INT_CONST_SUBTRACT_WRAPV) (INT_NEGATE_WRAPV, INT_CONST_MULTIPLY_WRAPV, INT_DIVIDE_WRAPV) (INT_REMAINDER_WRAPV, _GL_INT_OP_WRAPV, _GL_EXPR_CAST) (_GL_INT_OP_WRAPV_LONGISH, INT_ADD_WRAPV, INT_SUBTRACT_WRAPV) (INT_MULTIPLY_WRAPV, _GL_OP_OVERFLOW, _GL_OP_WRAPV, _GL_OP_WRAPV_GENSYM): New macros. (INT_ADD_OVERFLOW, INT_SUBTRACT_OVERFLOW, INT_MULTIPLY_OVERFLOW): Generate calls to GCC builtins if available, for speed. * tests/test-intprops.c (INT_CONST_DIVIDE_OVERFLOW) (INT_CONST_REMAINDER_OVERFLOW, INT_CONST_LEFT_SHIFT_OVERFLOW) (INT_CONST_DIVIDE_WRAPV, INT_CONST_REMAINDER_WRAPV) (INT_CONST_LEFT_SHIFT_WRAPV): New macros. (main, CHECK_BINOP, CHECK_UNOP, CHECK_SUM, CHECK_PRODUCT) (CHECK_QUOTIENT, CHECK_REMAINDER): Test WRAPV and CONST flavors (when available) too.
Paul Eggert b9bfe784 2015-01-01T01:38:23 version-etc: new year * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
Eric Blake 1276a2c5 2014-01-01T00:04:40 maint: update copyright I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
Paul Eggert d208f3ab 2013-11-03T19:52:32 intprops: port to Oracle Studio c99 * lib/intprops.h (_GL_HAVE___TYPEOF__) [__SUNPRO_C && __STDC__]: Define to 0, to avoid diagnostics when Oracle Studio is pedantic.
Paul Eggert 0488b6e8 2013-04-27T08:11:56 alignof, intprops, malloca: port better to IBM's C compiler * lib/alignof.h (alignof_type) [__IBM_ALIGNOF__]: Use __alignof__. * lib/intprops.h (_GL_HAVE___TYPEOF__) [__IBM_TYPEOF__]: Now 1. * lib/malloca.h (sa_alignof): [__IBM_ALIGNOF__]: Use __alignof__.
Eric Blake 9fc81090 2013-01-01T00:50:58 maint: update all copyright year number ranges Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering 1602f0af 2012-01-01T10:04:58 maint: update all copyright year number ranges Run "make update-copyright".
Jim Meyering cf2b9e84 2011-05-28T13:45:12 intprops.h: adjust another comment to match code change * lib/intprops.h (_GL_INT_SIGNED): Now, E may have side effects.
Jim Meyering dabf3a8d 2011-05-28T12:34:08 intprops.h: adjust comment to match code change * lib/intprops.h (_GL_INT_CONVERT): Adjust comment: now that E is used only once, it *may* have side effects. Also fix an unrelated typo.
Paul Eggert 8aad2a7b 2011-05-24T16:45:14 intprops: shorten, to pacify gcc -Woverlength-strings * lib/intprops.h (_GL_INT_CONVERT, _GL_INT_NEGATE_CONVERT): (_GL_BINARY_OP_OVERFLOW): Say "0 * (x)" rather than "(x) - (x)", so that, for example, verify (INT_MULTIPLY_OVERFLOW (...)) is less likely to run afoul of C compiler limits for string constant lengths. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00528.html>.
Paul Eggert 48552f31 2011-05-20T11:30:16 intprops: remove assumption about A|B representation * lib/intprops.h (_GL_BINARY_OP_OVERFLOW): Do not assume that A|B is a valid integer if both A and B are. Although this is true for all known practical hosts, the C standard doesn't guarantee it, and the code need not assume it. Also, this change may work around HP-UX 11.23 and IRIX 6.5 cc bugs reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00426.html>.
Paul Eggert 92c71a1c 2011-05-19T19:16:04 intprops: work around IRIX 6.5 cc bug with 0u - 0u + -1 See http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html * lib/intprops.h (_GL_INT_NEGATE_CONVERT): New macro. (_GL_INT_SIGNED, _GL_INT_MAXIMUM, _GL_DIVIDE_OVERFLOW): (_GL_REMAINDER_OVERFLOW): Use it.
Paul Eggert 8cc0fee0 2011-05-19T01:36:25 intprops: work around C compiler bugs * lib/intprops.h (INT_MULTIPLY_RANGE_OVERFLOW): Work around compiler bug in Sun C 5.11 2010/08/13 and other compilers; see <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.
Paul Eggert e873fd36 2011-05-15T09:35:12 intprops: add safe, portable integer overflow checking * lib/intprops.h (_GL_INT_CONVERT, _GL_INT_TWOS_COMPLEMENT): (_GL_INT_SIGNED, _GL_INT_MINIMUM, _GL_INT_MAXIMUM): (_GL_SIGNED_INT_MINIMUM, INT_ADD_RANGE_OVERFLOW): (INT__SUBTRACT__RANGE_OVERFLOW, INT_NEGATE_RANGE_OVERFLOW): (INT_MULTIPLY_RANGE_OVERFLOW, INT_REMAINDER_RANGE_OVERFLOW): (INT_LEFT_SHIFT_RANGE_OVERFLOW, _GL_ADD_OVERFLOW): (_GL__SUBTRACT__OVERFLOW, _GL_MULTIPLY_OVERFLOW, _GL_DIVIDE_OVERFLOW): (_GL_REMAINDER_OVERFLOW, _GL_UNSIGNED_NEG_MULTIPLE, INT_ADD_OVERFLOW): (INT__SUBTRACT__OVERFLOW, INT_NEGATE_OVERFLOW, INT_MULTIPLY_OVERFLOW): (INT_DIVIDE_OVERFLOW, INT_REMAINDER_OVERFLOW): (INT_LEFT_SHIFT_OVERFLOW, _GL_BINARY_OP_OVERFLOW): New macros.
Paul Eggert 65dc5d65 2011-05-08T12:28:01 intprops: Sun C 5.11 supports __typeof__ * lib/intprops.h (_GL_HAVE___TYPEOF__): New macro, which is set for either GCC 2 or later, as before, or for Sun C 5.11 or later, which is new. (_GL_SIGNED_TYPE_OR_EXPR): Use it.
Paul Eggert f40658a3 2011-05-08T11:53:53 intprops: switch to usual gnulib indenting and naming * lib/intprops.h (_GL_INTPROPS_H): Rename from GL_INTPROPS_H. (_GL_SIGNED_TYPE_OR_EXPR): Rename from signed_type_or_expr__. * tests/test-inttostr.c (IS_TIGHT): Adjust to above renaming.
Paul Eggert ee9e39c0 2011-01-29T23:59:31 TYPE_MAXIMUM: avoid theoretically undefined behavior * lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a negative number, which the C Standard says has undefined behavior. In practice this is not a problem, but might as well do it by the book. Reported by Rich Felker and Eric Blake; see <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>. * lib/strtol.c (TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Likewise. * m4/stdint.m4 (gl_STDINT_H): Likewise. * lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others.
Jim Meyering d60f3b0c 2011-01-01T20:17:23 maint: update almost all copyright ranges to include 2011 Run the new "make update-copyright" rule.
Paul Eggert 7b3b57be 2010-11-17T16:29:40 intprops: new macro INT_BITS_STRLEN_BOUND * lib/intprops.h (INT_BITS_STRLEN_BOUND): New macro, needed by ftoastr.h. This exposes an internal of intprops.h that was formerly not exposed. Also, it uses a slightly tighter bound than before; though this makes no practical difference, we might as well be as tight as we easily can.
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Eric Blake fdac57e8 2009-11-14T15:09:08 intprops: add double-inclusion guard * lib/intprops.h: Allow idempotent includes. Suggested by Bruce Korb. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 57fdfd3f 2007-10-07T19:14:58 Change copyright notice from GPLv2+ to GPLv3+.
Jim Meyering add25498 2005-09-27T08:40:36 (signed_type_or_expr__): Define. (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound for unsigned types.
Paul Eggert 267a39ba 2005-05-14T06:03:57 *** empty log message ***
Paul Eggert d3aea660 2005-03-26T17:53:44 one's complement -> ones' complement (as per Knuth)
Paul Eggert d6913e92 2005-03-26T17:47:53 (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): "value of type" -> "type or expression" in comment.
Jim Meyering 8baf2fec 2005-03-26T11:10:52 Comment nits. Add the apostrophe in `(one|two)'s complement'. Correct typos: s/or/of/.
Paul Eggert b6097b0f 2005-03-09T23:22:50 Add TYPE_ONES_COMPLEMENT and TYPE_SIGNED_MAGNITUDE, and use less-tricky TYPE_MINIMUM and TYPE_MAXIMUM.
Paul Eggert eef56b54 2005-03-09T19:11:23 Factor int-properties macros into a single file, except for glibc-related files. * lib/intprops.h: New file. * lib/getloadavg.c: Include it instead of limits.h. (INT_STRLEN_BOUND): Remove. * lib/human.c: Include intprops.h. (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself. * lib/human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000. * lib/inttostr.h: Include intprops.h instead of limits.h. (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove. * lib/mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros, for consistency with intprops.h. (time_t_is_integer, twos_complement_arithmetic): Use them. * lib/sig2str.h: Include <signal.h>, intprops.h. (INT_STRLEN_BOUND): Remove. * lib/strftime.c (TYPE_SIGNED): Remove. (INT_STRLEN_BOUND): Switch to same implementation as intprops.h. * lib/strtol.c: Adjust comments to match intprops.h. * lib/userspec.c: Include intprops.h. (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. * lib/utimecmp.c, lib/xnanosleep.c, lib/xstrtol.c: Likewise. * lib/utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT instead of rolling our own expressions. * lib/xstrtol.c: Include xstrtol.h first, to test interface. * modules/getloadavg (Files): Add lib/intprops.h. * modules/human (Files): Likewise. * modules/inttostr (Files): Likewise. * modules/sig2str (Files): Likewise. * modules/userspec (Files): Likewise. * modules/utimecmp (Files): Likewise. * modules/xnanosleep (Files): Likewise. * modules/xstrtol (Files): Likewise.