summaryrefslogtreecommitdiff
path: root/lib/intprops.h
Commit message (Collapse)AuthorAgeFilesLines
* Update from GnulibPaul Eggert2020-08-231-6/+9
| | | | | | | | | | | | | | This incorporates: 2020-08-23 intprops: be consistent about +X vs X+0 2020-08-23 intprops: fix INT_MULTIPLY_WRAPV bit-field bug 2020-08-23 verify: Make assume work on bit field expressions 2020-08-23 libc-config: Improve comments 2020-08-22 verify: Do use __builtin_assume on clang 2020-08-22 sig2str: Add more signals 2020-08-21 sigdescr_np: New module * lib/cdefs.h, lib/intprops.h, lib/sig2str.c, lib/string.in.h: * lib/verify.h, m4/string_h.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
* Update from GnulibPaul Eggert2020-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2020-08-16 time_rz: remove unused functions 2020-08-16 time_rz: fix issues with mktime_z failures 2020-08-16 nstrftime: Guide inlining also on clang 2020-08-16 intprops: Avoid bogus warning on clang 2020-08-16 libc-config: Enable __REDIRECT macro also on clang 2020-08-16 regex: Use initializer shorthand syntax also with clang 2020-08-16 regex: Use space optimization also with clang 2020-08-16 Use _Static_assert and static_assert when present on clang 2020-08-16 Use 'throw ()' for optimization in C++ mode also on clang 2020-08-16 stdio: Don't break attribute 'scanf' on clang 2020-08-16 Fix "warning: 'format' attribute ...: rpl_printf" 2020-08-16 Fix "warning: attribute declaration must precede definition" 2020-08-16 Fix undesired warnings 2020-08-16 Don't use Autoconf quadrigraphsxo 2020-08-16 Fix quoting of AC_LANG_PROGRAM arguments 2020-08-16 Assume autoconf >= 2.64 2020-08-15 nstrftime: be more predictable about errno 2020-08-15 canonicalize: Fix autoconf test on MSVC/clang 2020-08-15 Support compiling without -loldnames on native Windows 2020-08-14 mktime, mktime-internal: Remove obsolete code 2020-08-14 Assume tzset exists * lib/c++defs.h, lib/canonicalize-lgpl.c, lib/cdefs.h, lib/dup2.c: * lib/fcntl.in.h, lib/getopt-cdefs.in.h, lib/intprops.h, lib/md5.h: * lib/mktime.c, lib/nstrftime.c, lib/open.c, lib/regcomp.c: * lib/regex_internal.h, lib/stdio.in.h, lib/stdlib.in.h: * lib/strftime.h, lib/string.in.h, lib/sys_select.in.h: * lib/sys_stat.in.h, lib/sys_time.in.h, lib/time.in.h, lib/time_rz.c: * lib/unistd.in.h, lib/verify.h, m4/00gnulib.m4: * m4/absolute-header.m4, m4/alloca.m4, m4/canonicalize.m4, m4/dup2.m4: * m4/fchmodat.m4, m4/fcntl.m4, m4/fdopendir.m4, m4/fpending.m4: * m4/futimens.m4, m4/getdtablesize.m4, m4/getloadavg.m4: * m4/gnulib-common.m4, m4/include_next.m4, m4/largefile.m4: * m4/manywarnings.m4, m4/mktime.m4, m4/nstrftime.m4, m4/open-slash.m4: * m4/pselect.m4, m4/pthread_sigmask.m4, m4/time_h.m4, m4/utimens.m4: * m4/utimensat.m4, m4/utimes.m4, m4/warnings.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
* Update from GnulibPaul Eggert2020-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2020-08-11 Use expression statements also on clang 2020-08-10 Use many __attribute__s with clang 2020-08-09 Use attribute __aligned__ with clang 2020-08-09 Use __alignof__ with clang 2020-08-09 ignore-value: Simplify on clang 2020-08-09 Use __typeof__ with clang 2020-08-09 intprops: Fix typo in comment 2020-08-09 Silence warnings from clang 10 with -Wimplicit-fallthrough 2020-08-09 count-one-bits: Use __builtin_popcount{,l,ll} on clang 2020-08-09 string: Fix build error in C++ mode with clang 2020-08-09 Add ability to emit user-defined diagnostics with clang 2020-08-07 alloca: No need to compile alloca.c with clang 2020-08-06 Use __builtin_assume with clang * lib/alloca.in.h, lib/arg-nonnull.h, lib/c++defs.h, lib/cdefs.h: * lib/count-one-bits.h, lib/dirent.in.h, lib/ignore-value.h: * lib/intprops.h, lib/malloca.h, lib/regex_internal.h: * lib/stdalign.in.h, lib/stddef.in.h, lib/stdio.in.h: * lib/stdlib.in.h, lib/string.in.h, lib/verify.h, lib/warn-on-use.h: * m4/gnulib-common.m4, m4/stddef_h.m4, m4/stdint.m4: Copy from Gnulib.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Update from GnulibPaul Eggert2019-11-261-6/+11
| | | | | | | | | | | | | | | | | | | | | This incorporates: 2019-11-24 Fix errors in C++ mode on mingw 2019-11-24 time_r: Fix for mingw (regression from 2019-11-16) 2019-11-24 sys_time: Fix errors in C++ mode on mingw 2019-11-22 intprops: INT_MULTIPLY_WRAPV speedup for GCC 8.4+ 2019-11-21 Disable many _GL_CXXALIASWARN on non-glibc 2019-11-21 Fix various errors in _GL_CXXALIAS_SYS invocations 2019-11-19 intprops: INT_MULTIPLY_WRAPV speedup for GCC 9.3+ 2019-11-18 stdint: Define [u]intptr_t correctly on 64-bit native Windows 2019-11-18 stdint: Fix value of WINT_MAX when we override wint_t 2019-11-18 stdint: Avoid "conflicting types" error on mingw 5.22 2019-11-16 time_r: Fix for mingw 2019-11-06 regex: now back in sync with glibc * lib/intprops.h, lib/regexec.c, lib/signal.in.h: * lib/stdint.in.h, lib/stdio.in.h, lib/stdlib.in.h: * lib/string.in.h, lib/sys_select.in.h, lib/sys_time.in.h: * lib/time.in.h, lib/unistd.in.h, m4/time_r.m4: Copy from Gnulib.
* Update from GnulibPaul Eggert2019-10-241-19/+3
| | | | | | | | | | | This incorporates: 2019-10-23 nstrftime: speed up integer overflow checking 2019-10-23 port better to GCC under macOS 2019-10-15 inttypes: use more-robust test for int range 2019-10-14 update-copyright: use en dashes in .texi ranges * build-aux/update-copyright, lib/intprops.h, lib/inttypes.in.h: * lib/nstrftime.c, lib/verify.h: Copy from Gnulib.
* Update from GnulibPaul Eggert2019-09-021-31/+60
| | | | | | | | | | This incorporates: 2019-08-25 intprops.h, verify.h: port better to clang 2019-08-21 New strip-trailing-space option for srclist-update * .gitattributes: Remove doc/misc/texinfo.tex special case, which is no longer needed now that Gnulib trims blank-at-eol. * build-aux/install-sh, doc/misc/texinfo.tex, lib/intprops.h: * lib/regex_internal.c, lib/verify.h: Copy from Gnulib.
* Update from GnulibPaul Eggert2019-08-171-23/+34
| | | | | | | This incorporates: 2019-08-17 intprops: port to Oracle Developer Studio 12.6 2019-08-14 intprops: support uchar, ushort _WRAPV dests * lib/intprops.h: Copy from Gnulib.
* Update from GnulibPaul Eggert2019-08-141-28/+128
| | | | | | | | This incorporates: 2019-08-14 intprops: pacify picky GCC 2019-08-14 intprops: support unsigned *_WRAPV results 2019-08-12 verify: improve diagnostic quality in recent GCC * lib/intprops.h, lib/verify.h: Copy from Gnulib.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Update from GnulibPaul Eggert2018-09-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This incorporates: 2018-09-10 timespec: fix resolution confusion 2018-09-09 mktime: simplify in prep for glibc merge 2018-09-07 intprops: minor clarification of code 2018-09-06 stddef: Override max_align_t on NetBSD 8.0/x86 2018-09-06 fcntl: Fix F_DUPFD_CLOEXEC behaviour on Haiku 2018-09-06 strtoll, strtoull: Rely on limits-h module 2018-09-06 limits-h: Provide numerical limits macros 2018-09-06 fcntl: Don't access nonexistent optional argument 2018-09-02 mktime: fix unlikely race+overflow bug 2018-08-31 mktime, timegm: simplify glibc time64_t 2018-08-31 mktime, timegm: simplify merge to glibc * build-aux/config.guess, build-aux/config.sub: * lib/dtotimespec.c, lib/fcntl.c, lib/intprops.h: * lib/limits.in.h, lib/mktime-internal.h, lib/mktime.c: * lib/stat-time.h, lib/strtol.c, lib/timegm.c: * lib/timespec-add.c, lib/timespec-sub.c, lib/timespec.h: * lib/utimens.c, m4/limits-h.m4, m4/stddef_h.m4: Copy from Gnulib.
* | Update from GnulibPaul Eggert2018-08-271-7/+9
|/ | | | | | | | * build-aux/config.sub, lib/intprops.h, lib/regex_internal.c: * lib/regex_internal.h, lib/unistd.in.h, m4/limits-h.m4: * m4/stdint.m4, m4/unistd_h.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
* Merge from GnulibPaul Eggert2017-12-311-1/+1
| | | | | | | This incorporates: 2018-01-01 maint: Run 'make update-copyright' 2017-12-29 Add cross-compilation results for GNU/Hurd. 2017-12-12 explicit_bzero: port to macOS + Clang 9.0.0
* Merge from GnulibPaul Eggert2017-11-251-3/+3
| | | | | | | | | | | | | | This incorporates: 2017-11-23 stat: work around Solaris bug with tv_nsec < 0 2017-11-12 maint: shorten https://lists.gnu.org/archive/html/... links * build-aux/config.sub, doc/misc/texinfo.tex, lib/allocator.h: * lib/fstatat.c, lib/intprops.h, lib/lstat.c, lib/signal.in.h: * lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h: * lib/timespec.h, m4/alloca.m4, m4/extern-inline.m4: * m4/faccessat.m4, m4/fstatat.m4, m4/gnulib-common.m4: * m4/lstat.m4, m4/std-gnu11.m4, m4/sys_types_h.m4: * m4/vararrays.m4: Copy from Gnulib.
* Merge from GnulibPaul Eggert2017-09-171-3/+3
| | | | | | | | | | | | | | | | | This incorporates: 2017-09-16 manywarnings: port to GCC on 64-bit MS-Windows 2017-09-13 all: Replace many more http URLs by https URLs * build-aux/config.guess, build-aux/config.sub: * build-aux/gitlog-to-changelog, doc/misc/texinfo.tex: * lib/allocator.h, lib/count-leading-zeros.h: * lib/count-trailing-zeros.h, lib/dup2.c, lib/filevercmp.c: * lib/fstatat.c, lib/fsync.c, lib/ftoastr.c, lib/ftoastr.h: * lib/intprops.h, lib/signal.in.h, lib/stdio-impl.h, lib/stdio.in.h: * lib/unistd.in.h, lib/utimens.c, m4/alloca.m4, m4/extern-inline.m4: * m4/fstatat.m4, m4/gnulib-common.m4, m4/manywarnings.m4: * m4/std-gnu11.m4, m4/sys_types_h.m4, m4/vararrays.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
* Merge from GnulibPaul Eggert2017-09-131-1/+1
| | | | | | | This incorporates: 2017-09-13 all: prefer https: URLs This just changes http: to https: in comments, in files copied from Gnulib.
* Merge from gnulibPaul Eggert2017-05-251-1/+5
| | | | | | This incorporates: 2017-05-25 port to recent icc * lib/intprops.h: Copy from gnulib.
* Merge from gnulibPaul Eggert2017-05-081-19/+1
| | | | | | | | 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.
* Merge from gnulibPaul Eggert2017-04-151-19/+28
| | | | | | | 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.
* Merge from gnulibPaul Eggert2017-01-101-8/+2
| | | | | | | | | | | | 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.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | Update from gnulibPaul Eggert2016-11-041-1/+2
| | | | | | | | | | | | This incorporates: 2016-11-03 intprops: port to older XL C * lib/intprops.h: Copy from gnulib.
* | Update from gnulibPaul Eggert2016-09-151-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Update from gnulibPaul Eggert2016-08-301-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Update from gnulibPaul Eggert2016-06-241-20/+37
| | | | | | | | | | | | | | | | 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.
* | Sync from gnulibPaul Eggert2016-05-011-23/+22
|/ | | | | | | | | | | | | | | | 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.
* Sync with gnulibPaul Eggert2016-03-101-4/+4
| | | | | | | | | | 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.
* Merge from gnulibPaul Eggert2016-01-011-1/+1
| | | | | This mostly just updates copyright dates of gnulib files. It also updates to the latest version of texinfo.tex.
* Merge from gnulibPaul Eggert2015-12-181-3/+4
| | | | | | This mostly commentary fixes. * doc/misc/texinfo.tex, lib/intprops.h: Copy from gnulib. * lib/gnulib.mk: Regenerate with new gnulib-tool.
* Merge from gnulibPaul Eggert2015-11-101-10/+9
| | | | | | | 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.
* Merge from gnulibPaul Eggert2015-11-071-113/+105
| | | | | | | | | 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.
* Merge from gnulib.Paul Eggert2015-10-301-12/+129
| | | | | | | | 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.
* Merge from gnulib, incorporating:Paul Eggert2015-01-011-1/+1
| | | | 2015-01-01 version-etc: new year
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Port to stricter C99 platforms.Paul Eggert2013-11-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge from gnulib.Paul Eggert2013-04-271-1/+1
|
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* Merge from gnulib.Paul Eggert2012-05-261-1/+1
| | | | Fixes: debbugs:11527
* Adjust to recent gnulib change for @GUARD_PREFIX@.Paul Eggert2011-05-291-4/+3
|
* * doc/misc/texinfo.tex, lib/getopt.c, lib/intprops.h: Merge from gnulib.Paul Eggert2011-05-271-4/+4
|
* Merge from gnulib.Paul Eggert2011-05-221-16/+22
|
* Merge from gnulib.Paul Eggert2011-05-151-35/+263
|
* gnulib: import mktime and move-if-change fixes from gnulibPaul Eggert2011-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Regenerate.Paul Eggert2011-01-081-0/+86