summaryrefslogtreecommitdiff
path: root/lib/intprops.h
AgeCommit message (Collapse)Author
2017-05-25Merge from gnulibPaul Eggert
This incorporates: 2017-05-25 port to recent icc * lib/intprops.h: Copy from gnulib.
2017-05-08Merge from gnulibPaul Eggert
This incorporates: 2017-05-08 intprops: don’t depend on ‘verify’ 2017-05-07 utimens: on native Windows, improve resolution if fd < 0 2017-05-07 utimens: Improve error code on native Windows * lib/intprops.h, lib/utimens.c: Copy from gnulib.
2017-04-15Merge from gnulibPaul Eggert
This incorporates: 2017-04-14 intprops: try to avoid tickling similar bugs 2017-04-14 intprops: port to Oracle Studio 12.3 x86 * doc/misc/texinfo.tex, lib/intprops.h: Copy from gnulib.
2017-01-10Merge from gnulibPaul Eggert
This incorporates: 2017-01-09 maint: time stamp -> timestamp 2017-01-07 stdioext: Port to Minix 3.2 and newer 2017-01-06 glob, intprops, xalloc: work around Clang bug 2017-01-02 revert copyright-year change to synced files * doc/misc/texinfo.tex, lib/fpending.c, lib/intprops.h, lib/mktime.c: * lib/stat-time.h, lib/stdio-impl.h, lib/time.in.h, lib/timespec.h: * lib/utimens.c, lib/xalloc-oversized.h: Copy from gnulib.
2017-01-01Merge from origin/emacs-25Paul Eggert
2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
2016-12-31Update copyright year to 2017Paul Eggert
Run admin/update-copyright.
2016-11-04Update from gnulibPaul Eggert
This incorporates: 2016-11-03 intprops: port to older XL C * lib/intprops.h: Copy from gnulib.
2016-09-15Update from gnulibPaul Eggert
This incorporates: 2016-09-15 stdint: support new _WIDTH macros 2016-09-15 limits-h: new module 2016-09-15 sys_types: avoid glibc 2.25 warnings about major() 2016-09-15 extensions: port to more ISO C TSes 2016-09-13 intprops: new macro TYPE_WIDTH 2016-09-13 extensions: port to recent ISO C TRs * .gitignore: Add lib/limits.h. * doc/misc/texinfo.tex, lib/ftoastr.h, lib/intprops.h: * lib/stdint.in.h, m4/extensions.m4, m4/stdint.m4, m4/stdio_h.m4: * m4/sys_types_h.m4: Copy from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/limits.in.h, m4/limits-h.m4: New files, copie from gnulib. * nt/gnulib.mk: Merge changes from lib/gnulib.mk.
2016-08-30Update from gnulibPaul Eggert
This incorporates: 2016-08-30 intprops: tune INT_NEGATE_OVERFLOW for GCC 5 and 6 2016-08-29 xalloc-oversized.h: port change to GCC 6.2.0 2016-08-29 intprops.h: port recent changes to GCC 6.2.0 2016-08-29 intprops.h: use __typeof__ with GCC 7 2016-08-29 intprops.h, xalloc-oversized.h: work with gcc 7 2016-08-24 intprops: fix paren typo on old platforms 2016-08-24 intprops: port to OpenVMS * lib/intprops.h, lib/xalloc-oversized.h: Copy from gnulib.
2016-06-24Update from gnulibPaul Eggert
This incorporates: 2016-06-24 intprops: port better to GCC 7 2016-06-13 xalloc-oversized: port to GCC 7; fewer warnings * doc/misc/texinfo.tex, lib/xalloc-oversized.h, lib/intprops.h: Copy from gnulib.
2016-05-01Sync from gnulibPaul Eggert
This incorporates: 2016-05-01 mktime: port to stricter signed overflow checking 2016-05-01 mktime: speed up DEBUG_MKTIME benchmarks 2016-05-01 mktime: resurrect DEBUG_MKTIME testing 2016-05-01 mktime: simplify DEBUG_MKTIME 2016-05-01 Port mktime_internal offset to unsigned time_t 2016-04-27 xstrtol: prohibit monstrosities like "1bB" 2016-04-13 mktime: improve integer overflow checking 2016-04-13 intprops: check two's complement assumption 2016-04-13 intprops, mktime, strtol: assume two's complement * lib/intprops.h, lib/mktime-internal.h, lib/mktime.c: * lib/strtol.c, lib/timegm.c, m4/mktime.m4, m4/std-gnu11.m4: Copy from gnulib.
2016-03-10Sync with gnulibPaul Eggert
This incorporates: 2016-03-08 intprops: make .h file license match module 2016-03-08 acl: fix missing return on Cygwin 2016-03-05 extern-inline: port to PGI CC * doc/misc/texinfo.tex, lib/intprops.h, lib/set-permissions.c: * m4/extern-inline.m4: Copy from gnulib.
2016-01-01Merge from gnulibPaul Eggert
This mostly just updates copyright dates of gnulib files. It also updates to the latest version of texinfo.tex.
2015-12-18Merge from gnulibPaul Eggert
This mostly commentary fixes. * doc/misc/texinfo.tex, lib/intprops.h: Copy from gnulib. * lib/gnulib.mk: Regenerate with new gnulib-tool.
2015-11-10Merge from gnulibPaul Eggert
This incorporates: 2015-11-10 intprops: new public macro EXPR_SIGNED 2015-11-10 intprops: fix typo in clang port * lib/intprops.h: Copy from gnulib.
2015-11-07Merge from gnulibPaul Eggert
This incorporates: 2015-11-05 timespec-sub: fix overflow bug; add tests 2015-11-04 intprops: revise _WRAPV macros, revert _OVERFLOW 2015-11-03 intprops: add parentheses * lib/intprops.h, lib/timespec-add.c, lib/timespec-sub.c: Copy from gnulib.
2015-10-30Merge from gnulib.Paul Eggert
This incorporates: 2015-10-30 intprops: add WRAPV and const flavors for GCC 5 2015-10-25 stdalign: port to Sun C 5.9 * doc/misc/texinfo.tex, lib/intprops.h, lib/stdalign.in.h: Copy from gnulib.
2015-01-01Merge from gnulib, incorporating:Paul Eggert
2015-01-01 version-etc: new year
2014-01-01Update copyright year to 2014 by running admin/update-copyright.Paul Eggert
2013-11-03Port to stricter C99 platforms.Paul Eggert
Especially, C99 prohibits nesting a struct X inside struct Y if struct X has a flexible array member. Also, merge from gnulib, incorporating: 2013-11-03 intprops: port to Oracle Studio c99 * lib/intprops.h: Update from gnulib. * src/alloc.c (struct sdata): New type. (sdata): Implement in terms of struct sdata. Remove u member; all uses replaced by next_vector, set_next_vector. (SDATA_SELECTOR, SDATA_DATA, SDATA_DATA_OFFSET): Adjust to sdata change. (SDATA_DATA_OFFSET): Now a constant, not a macro. (struct sblock): Rename first_data member to data, which is now a flexible array member. All uses changed. (next_vector, set_next_vector, large_vector_vec): New functions. (vector_alignment): New constant. (roundup_size): Make it a multiple of ALIGNOF_STRUCT_LISP_VECTOR, too. (struct large-vector): Now merely a NEXT member, since the old approach ran afoul of stricter C99. All uses changed to use large_vector_vec or large_vector_offset. (large_vector_offset): New constant. * src/dispnew.c: Include tparam.h, for tgetent. Do not include term.h; no longer needed. * src/gnutls.c (Fgnutls_boot): Don't continue after calling a _Noreturn. * src/lisp.h (ENUM_BF) [__SUNPRO_C && __STDC__]: Use unsigned int. (struct Lisp_Vector): Use a flexible array member for contents, instead of a union with a member that is an array of size 1. All uses changed. (ALIGNOF_STRUCT_LISP_VECTOR): New constant, to make up for the fact that the struct no longer contains a union. (struct Lisp_Misc_Any, struct Lisp_Marker, struct Lisp_Overlay) (struct Lisp_Save_Value, struct Lisp_Free): Use unsigned, not int, for spacers, to avoid c99 warning. (union specbinding): Use unsigned, not bool, for bitfield, as bool is not portable to pre-C99 hosts.
2013-04-27Merge from gnulib.Paul Eggert
2013-01-01Update copyright notices for 2013.Paul Eggert
2012-05-26Merge from gnulib.Paul Eggert
Fixes: debbugs:11527
2011-05-29Adjust to recent gnulib change for @GUARD_PREFIX@.Paul Eggert
2011-05-27* doc/misc/texinfo.tex, lib/getopt.c, lib/intprops.h: Merge from gnulib.Paul Eggert
2011-05-22Merge from gnulib.Paul Eggert
2011-05-15Merge from gnulib.Paul Eggert
2011-01-30gnulib: import mktime and move-if-change fixes from gnulibPaul Eggert
* configure: Regenerate from the following. 2011-01-30 Paul Eggert <eggert@cs.ucla.edu> mktime: clarify long_int width checking * lib/mktime.c (long_int_is_wide_enough): Move this assertion to the top level, to make it clearer that the assumption about long_int width is being checked. See <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00554.html>. 2011-01-29 Paul Eggert <eggert@cs.ucla.edu> 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>. * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. * lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others. mktime: #undef mktime before #defining it * lib/mktime.c (mktime) [DEBUG]: #undef mktime before #defining it. mktime: systematically normalize tm_isdst comparisons * lib/mktime.c (isdst_differ): New function. (__mktime_internal): Use it systematically for all isdst comparisons. This completes the fix for libc BZ #6723, and removes the need for normalizing tm_isdst. See <http://sourceware.org/bugzilla/show_bug.cgi?id=6723> (not_equal_tm) [DEBUG]: Use isdst_differ here, too. mktime: fix some integer overflow issues and sidestep the rest This was prompted by a bug report by Benjamin Lindner for MinGW <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00472.html>. His bug is due to signed integer overflow (0 - INT_MIN), and I I scanned through mktime.c looking for other integer overflow problems, fixing all the bugs I found. Although the C Standard says the resulting code is still not safe in the presence of integer overflow, in practice it should be good enough for all real-world two's-complement implementations, except for debugging environments that deliberately trap on integer overflow (e.g., gcc -ftrapv). * lib/mktime.c (WRAPV): New macro. (SHR): Also check that long_int and time_t shift right in the usual way, before using the fast-but-unportable method. (TYPE_ONES_COMPLEMENT, TYPE_SIGNED_MAGNITUDE): Remove, no longer used. The code already assumed two's complement, so there's no need to test for alternatives. All uses removed. (TYPE_MAXIMUM): Don't rely here on overflow behavior not defined by the C standard. Problem reported by Rich Felker in <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00488.html>. (twos_complement_arithmetic): Also check long_int and time_t. (time_t_avg, time_t_add_ok, time_t_int_add_ok): New functions. (guess_time_tm, ranged_convert, __mktime_internal): Use them. (__mktime_internal): Avoid integer overflow with unary subtraction in two instances where -1 - X is an adequate replacement for -X, since the calculations are approximate. 2011-01-29 Eric Blake <eblake@redhat.com> mktime: avoid infinite loop * m4/mktime.m4 (AC_FUNC_MKTIME): Avoid overflow on possibly-signed type; behavior is still undefined but portable to all known targets. Reported by Rich Felker. 2011-01-28 Paul Eggert <eggert@cs.ucla.edu> mktime: avoid problems on NetBSD 5 / i386 * lib/mktime.c (long_int): New type. This works around a problem on NetBSD 5 / i386, where 'long int' and 'int' are both 32 bits but time_t is 64 bits, and where I expect the existing code is wrong in some cases. (leapyear, ydhms_diff, guess_time_tm, __mktime_internal): Use it. (ydhms_diff): Bring back the compile-time check for wide-enough year and yday. mktime: fix misspelling in comment * lib/mktime.c (__mktime_internal): Fix misspelling in comment. This merges all recent glibc changes of importance. 2011-01-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> move-if-change: cope with concurrent mv of identical file. * move-if-change (CMPPROG): Accept environment variable as an override for `cmp'. (usage): Document CMPPROG. Adjust comparison to drop stdout. Cope with failure of mv if the target file exists and is identical to the source, for parallel builds. Report from H.J. Lu against binutils in PR binutils/12283.
2011-01-08Regenerate.Paul Eggert