aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2023-08-12 12:50:15 -0700
committerPaul Eggert2023-08-12 12:57:35 -0700
commitf3868cb9d1806b35186eabc0262393316ebe689a (patch)
treeb94176760150b6994aacf74292a12ba0890b9222
parentb66c16c789d8046ff40c48b9346b26238b1b97e1 (diff)
downloademacs-f3868cb9d1806b35186eabc0262393316ebe689a.tar.gz
emacs-f3868cb9d1806b35186eabc0262393316ebe689a.zip
Update from Gnulib by running admin/merge-gnulib
-rwxr-xr-xbuild-aux/config.guess33
-rwxr-xr-xbuild-aux/config.sub37
-rw-r--r--doc/misc/texinfo.tex257
-rw-r--r--lib/diffseq.h24
-rw-r--r--lib/gnulib.mk.in6
-rw-r--r--lib/time.in.h81
-rw-r--r--m4/clock_time.m432
-rw-r--r--m4/mktime.m43
-rw-r--r--m4/nanosleep.m46
-rw-r--r--m4/stdalign.m410
-rw-r--r--m4/time_h.m435
-rw-r--r--m4/time_r.m44
-rw-r--r--m4/timegm.m43
-rw-r--r--src/Makefile.in4
14 files changed, 371 insertions, 164 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 354a8ccde42..b187213930f 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -4,7 +4,7 @@
4 4
5# shellcheck disable=SC2006,SC2268 # see below for rationale 5# shellcheck disable=SC2006,SC2268 # see below for rationale
6 6
7timestamp='2023-06-23' 7timestamp='2023-07-20'
8 8
9# This file is free software; you can redistribute it and/or modify it 9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by 10# under the terms of the GNU General Public License as published by
@@ -976,7 +976,27 @@ EOF
976 GUESS=$UNAME_MACHINE-unknown-minix 976 GUESS=$UNAME_MACHINE-unknown-minix
977 ;; 977 ;;
978 aarch64:Linux:*:*) 978 aarch64:Linux:*:*)
979 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 979 set_cc_for_build
980 CPU=$UNAME_MACHINE
981 LIBCABI=$LIBC
982 if test "$CC_FOR_BUILD" != no_compiler_found; then
983 ABI=64
984 sed 's/^ //' << EOF > "$dummy.c"
985 #ifdef __ARM_EABI__
986 #ifdef __ARM_PCS_VFP
987 ABI=eabihf
988 #else
989 ABI=eabi
990 #endif
991 #endif
992EOF
993 cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
994 eval "$cc_set_abi"
995 case $ABI in
996 eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
997 esac
998 fi
999 GUESS=$CPU-unknown-linux-$LIBCABI
980 ;; 1000 ;;
981 aarch64_be:Linux:*:*) 1001 aarch64_be:Linux:*:*)
982 UNAME_MACHINE=aarch64_be 1002 UNAME_MACHINE=aarch64_be
@@ -1042,6 +1062,15 @@ EOF
1042 k1om:Linux:*:*) 1062 k1om:Linux:*:*)
1043 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1063 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1044 ;; 1064 ;;
1065 kvx:Linux:*:*)
1066 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067 ;;
1068 kvx:cos:*:*)
1069 GUESS=$UNAME_MACHINE-unknown-cos
1070 ;;
1071 kvx:mbr:*:*)
1072 GUESS=$UNAME_MACHINE-unknown-mbr
1073 ;;
1045 loongarch32:Linux:*:* | loongarch64:Linux:*:*) 1074 loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1046 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1075 GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1047 ;; 1076 ;;
diff --git a/build-aux/config.sub b/build-aux/config.sub
index 9865d6ea4d1..6ae25027537 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -4,7 +4,7 @@
4 4
5# shellcheck disable=SC2006,SC2268 # see below for rationale 5# shellcheck disable=SC2006,SC2268 # see below for rationale
6 6
7timestamp='2023-06-26' 7timestamp='2023-07-31'
8 8
9# This file is free software; you can redistribute it and/or modify it 9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by 10# under the terms of the GNU General Public License as published by
@@ -1206,6 +1206,7 @@ case $cpu-$vendor in
1206 | i370 | i*86 | i860 | i960 | ia16 | ia64 \ 1206 | i370 | i*86 | i860 | i960 | ia16 | ia64 \
1207 | ip2k | iq2000 \ 1207 | ip2k | iq2000 \
1208 | k1om \ 1208 | k1om \
1209 | kvx \
1209 | le32 | le64 \ 1210 | le32 | le64 \
1210 | lm32 \ 1211 | lm32 \
1211 | loongarch32 | loongarch64 \ 1212 | loongarch32 | loongarch64 \
@@ -1214,31 +1215,7 @@ case $cpu-$vendor in
1214 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ 1215 | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1215 | m88110 | m88k | maxq | mb | mcore | mep | metag \ 1216 | m88110 | m88k | maxq | mb | mcore | mep | metag \
1216 | microblaze | microblazeel \ 1217 | microblaze | microblazeel \
1217 | mips | mipsbe | mipseb | mipsel | mipsle \ 1218 | mips* \
1218 | mips16 \
1219 | mips64 | mips64eb | mips64el \
1220 | mips64octeon | mips64octeonel \
1221 | mips64orion | mips64orionel \
1222 | mips64r5900 | mips64r5900el \
1223 | mips64vr | mips64vrel \
1224 | mips64vr4100 | mips64vr4100el \
1225 | mips64vr4300 | mips64vr4300el \
1226 | mips64vr5000 | mips64vr5000el \
1227 | mips64vr5900 | mips64vr5900el \
1228 | mipsisa32 | mipsisa32el \
1229 | mipsisa32r2 | mipsisa32r2el \
1230 | mipsisa32r3 | mipsisa32r3el \
1231 | mipsisa32r5 | mipsisa32r5el \
1232 | mipsisa32r6 | mipsisa32r6el \
1233 | mipsisa64 | mipsisa64el \
1234 | mipsisa64r2 | mipsisa64r2el \
1235 | mipsisa64r3 | mipsisa64r3el \
1236 | mipsisa64r5 | mipsisa64r5el \
1237 | mipsisa64r6 | mipsisa64r6el \
1238 | mipsisa64sb1 | mipsisa64sb1el \
1239 | mipsisa64sr71k | mipsisa64sr71kel \
1240 | mipsr5900 | mipsr5900el \
1241 | mipstx39 | mipstx39el \
1242 | mmix \ 1219 | mmix \
1243 | mn10200 | mn10300 \ 1220 | mn10200 | mn10300 \
1244 | moxie \ 1221 | moxie \
@@ -1733,7 +1710,7 @@ case $os in
1733 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ 1710 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1734 | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ 1711 | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
1735 | hiux* | abug | nacl* | netware* | windows* \ 1712 | hiux* | abug | nacl* | netware* | windows* \
1736 | os9* | macos* | osx* | ios* \ 1713 | os9* | macos* | osx* | ios* | tvos* | watchos* \
1737 | mpw* | magic* | mmixware* | mon960* | lnews* \ 1714 | mpw* | magic* | mmixware* | mon960* | lnews* \
1738 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ 1715 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1739 | aos* | aros* | cloudabi* | sortix* | twizzler* \ 1716 | aos* | aros* | cloudabi* | sortix* | twizzler* \
@@ -1759,7 +1736,7 @@ case $os in
1759 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ 1736 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1760 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ 1737 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1761 | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ 1738 | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1762 | fiwix* | mlibc* ) 1739 | fiwix* | mlibc* | cos* | mbr* )
1763 ;; 1740 ;;
1764 # This one is extra strict with allowed versions 1741 # This one is extra strict with allowed versions
1765 sco3.2v2 | sco3.2v[4-9]* | sco5v6*) 1742 sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
@@ -1816,6 +1793,10 @@ case $kernel-$os in
1816 ;; 1793 ;;
1817 *-eabi* | *-gnueabi*) 1794 *-eabi* | *-gnueabi*)
1818 ;; 1795 ;;
1796 none-coff* | none-elf*)
1797 # None (no kernel, i.e. freestanding / bare metal),
1798 # can be paired with an output format "OS"
1799 ;;
1819 -*) 1800 -*)
1820 # Blank kernel with real OS is always fine. 1801 # Blank kernel with real OS is always fine.
1821 ;; 1802 ;;
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index b1d2999e5d7..6e521944b22 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2023-07-02.10} 6\def\texinfoversion{2023-07-27.21}
7% 7%
8% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc. 8% Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
9% 9%
@@ -426,42 +426,21 @@
426} 426}
427 427
428% First remove any @comment, then any @c comment. Pass the result on to 428% First remove any @comment, then any @c comment. Pass the result on to
429% \argcheckspaces. 429% \argremovespace.
430\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} 430\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
431\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} 431\def\argremovec#1\c#2\ArgTerm{\argremovespace#1$ $\ArgTerm}
432 432% \argremovec might leave us with trailing space, though; e.g.,
433% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
434%
435% \argremovec might leave us with trailing space, e.g.,
436% @end itemize @c foo 433% @end itemize @c foo
437% This space token undergoes the same procedure and is eventually removed 434% Note that the argument cannot contain the TeX $, as its catcode is
438% by \finishparsearg. 435% changed to \other when Texinfo source is read.
439% 436\def\argremovespace#1 $#2\ArgTerm{\finishparsearg#1$\ArgTerm}
440\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
441\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
442\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
443 \def\temp{#3}%
444 \ifx\temp\empty
445 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
446 \let\temp\finishparsearg
447 \else
448 \let\temp\argcheckspaces
449 \fi
450 % Put the space token in:
451 \temp#1 #3\ArgTerm
452}
453 437
454% If a _delimited_ argument is enclosed in braces, they get stripped; so 438% If a _delimited_ argument is enclosed in braces, they get stripped; so
455% to get _exactly_ the rest of the line, we had to prevent such situation. 439% to get _exactly_ the rest of the line, we had to prevent such situation.
456% We prepended an \empty token at the very beginning and we expand it now, 440% We prepended an \empty token at the very beginning and we expand it
457% just before passing the control to \argtorun. 441% just before passing the control to \next.
458% (Similarly, we have to think about #3 of \argcheckspacesY above: it is 442% (But first, we have to remove the remaining $ or two.)
459% either the null string, or it ends with \^^M---thus there is no danger 443\def\finishparsearg#1$#2\ArgTerm{\expandafter\argtorun\expandafter{#1}}
460% that a pair of braces would be stripped.
461%
462% But first, we have to remove the trailing space token.
463%
464\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
465 444
466 445
467% \parseargdef - define a command taking an argument on the line 446% \parseargdef - define a command taking an argument on the line
@@ -5575,6 +5554,11 @@ might help (with 'rm \jobname.?? \jobname.??s')%
5575\newdimen\entryrightmargin 5554\newdimen\entryrightmargin
5576\entryrightmargin=0pt 5555\entryrightmargin=0pt
5577 5556
5557% amount to indent subsequent lines in an entry when it spans more than
5558% one line.
5559\newdimen\entrycontskip
5560\entrycontskip=1em
5561
5578% for PDF output, whether to make the text of the entry a link to the page 5562% for PDF output, whether to make the text of the entry a link to the page
5579% number. set for @contents and @shortcontents where there is only one 5563% number. set for @contents and @shortcontents where there is only one
5580% page number. 5564% page number.
@@ -5684,25 +5668,30 @@ might help (with 'rm \jobname.?? \jobname.??s')%
5684 \advance\dimen@ii by 1\dimen@i 5668 \advance\dimen@ii by 1\dimen@i
5685 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line 5669 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5686 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text 5670 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5671 % Undo changes above
5672 \advance \parfillskip by 0pt minus -1\dimen@i
5673 \advance\dimen@ii by -1\dimen@i
5674 %
5687 % Try to split the text roughly evenly. \dimen@ will be the length of 5675 % Try to split the text roughly evenly. \dimen@ will be the length of
5688 % the first line. 5676 % the first line.
5689 \dimen@ = 0.7\dimen@ 5677 \dimen@ = 0.7\dimen@
5690 \dimen@ii = \hsize 5678 \dimen@ii = \hsize
5691 \ifnum\dimen@>\dimen@ii 5679 \ifnum\dimen@>\dimen@ii
5692 % If the entry is too long (for example, if it needs more than 5680 % If the entry is too long (for example, if it needs more than
5693 % two lines), use all the space in the first line. 5681 % two lines), use the same line length for all lines.
5694 \dimen@ = \dimen@ii 5682 \dimen@ = \dimen@ii
5683 \else
5684 \advance \dimen@ by 1\rightskip
5695 \fi 5685 \fi
5696 \advance\leftskip by 0pt plus 1fill % ragged right 5686 \advance\leftskip by 0pt plus 1fill % ragged right
5697 \advance \dimen@ by 1\rightskip
5698 \parshape = 2 0pt \dimen@ 0em \dimen@ii 5687 \parshape = 2 0pt \dimen@ 0em \dimen@ii
5699 % Ideally we'd add a finite glue at the end of the first line only, 5688 % Ideally we'd add a finite glue at the end of the first line only,
5700 % instead of using \parshape with explicit line lengths, but TeX 5689 % instead of using \parshape with explicit line lengths, but TeX
5701 % doesn't seem to provide a way to do such a thing. 5690 % doesn't seem to provide a way to do such a thing.
5702 % 5691 %
5703 % Indent all lines but the first one. 5692 % Indent all lines but the first one.
5704 \advance\leftskip by 1em 5693 \advance\leftskip by \entrycontskip
5705 \advance\parindent by -1em 5694 \advance\parindent by -\entrycontskip
5706 \fi\fi 5695 \fi\fi
5707 \indent % start paragraph 5696 \indent % start paragraph
5708 \unhbox\boxA 5697 \unhbox\boxA
@@ -6721,6 +6710,82 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6721 \input \tocreadfilename 6710 \input \tocreadfilename
6722} 6711}
6723 6712
6713% process toc file to find the maximum width of the section numbers for
6714% each chapter
6715\def\findsecnowidths{%
6716 \begingroup
6717 \setupdatafile
6718 \activecatcodes
6719 \secentryfonts
6720 % Redefinitions
6721 \def\numchapentry##1##2##3##4{%
6722 \def\curchapname{secnowidth-##2}%
6723 \curchapmax=0pt
6724 }%
6725 \let\appentry\numchapentry
6726 %
6727 \def\numsecentry##1##2##3##4{%
6728 \def\cursecname{secnowidth-##2}%
6729 \cursecmax=0pt
6730 %
6731 \setbox0=\hbox{##2}%
6732 \ifdim\wd0>\curchapmax
6733 \curchapmax=\wd0
6734 \expandafter\xdef\csname\curchapname\endcsname{\the\wd0}%
6735 \fi
6736 }%
6737 \let\appsecentry\numsecentry
6738 %
6739 \def\numsubsecentry##1##2##3##4{%
6740 \def\curssecname{secnowidth-##2}%
6741 \curssecmax=0pt
6742 %
6743 \setbox0=\hbox{##2}%
6744 \ifdim\wd0>\cursecmax
6745 \cursecmax=\wd0
6746 \expandafter\xdef\csname\cursecname\endcsname{\the\wd0}%
6747 \fi
6748 }%
6749 \let\appsubsecentry\numsubsecentry
6750 %
6751 \def\numsubsubsecentry##1##2##3##4{%
6752 \setbox0=\hbox{##2}%
6753 \ifdim\wd0>\curssecmax
6754 \curssecmax=\wd0
6755 \expandafter\xdef\csname\curssecname\endcsname{\the\wd0}%
6756 \fi
6757 }%
6758 \let\appsubsubsecentry\numsubsubsecentry
6759 %
6760 % Discard any output by outputting to dummy vbox, in case the toc file
6761 % contains macros that we have not redefined above.
6762 \setbox\dummybox\vbox\bgroup
6763 \input \tocreadfilename\relax
6764 \egroup
6765 \endgroup
6766}
6767\newdimen\curchapmax
6768\newdimen\cursecmax
6769\newdimen\curssecmax
6770
6771
6772% set #1 to the maximum section width for #2
6773\def\retrievesecnowidth#1#2{%
6774 \expandafter\let\expandafter\savedsecnowidth \csname secnowidth-#2\endcsname
6775 \ifx\savedsecnowidth\relax
6776 #1=0pt
6777 \else
6778 #1=\savedsecnowidth
6779 \fi
6780}
6781\newdimen\secnowidthchap
6782\secnowidthchap=0pt
6783\newdimen\secnowidthsec
6784\secnowidthsec=0pt
6785\newdimen\secnowidthssec
6786\secnowidthssec=0pt
6787
6788
6724\newskip\contentsrightmargin \contentsrightmargin=1in 6789\newskip\contentsrightmargin \contentsrightmargin=1in
6725\newcount\savepageno 6790\newcount\savepageno
6726\newcount\lastnegativepageno \lastnegativepageno = -1 6791\newcount\lastnegativepageno \lastnegativepageno = -1
@@ -6766,6 +6831,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6766 \startcontents{\putwordTOC}% 6831 \startcontents{\putwordTOC}%
6767 \openin 1 \tocreadfilename\space 6832 \openin 1 \tocreadfilename\space
6768 \ifeof 1 \else 6833 \ifeof 1 \else
6834 \findsecnowidths
6769 \readtocfile 6835 \readtocfile
6770 \fi 6836 \fi
6771 \vfill \eject 6837 \vfill \eject
@@ -6793,6 +6859,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6793 \rm 6859 \rm
6794 \hyphenpenalty = 10000 6860 \hyphenpenalty = 10000
6795 \advance\baselineskip by 1pt % Open it up a little. 6861 \advance\baselineskip by 1pt % Open it up a little.
6862 \extrasecnoskip=0.4pt
6796 \def\numsecentry##1##2##3##4{} 6863 \def\numsecentry##1##2##3##4{}
6797 \let\appsecentry = \numsecentry 6864 \let\appsecentry = \numsecentry
6798 \let\unnsecentry = \numsecentry 6865 \let\unnsecentry = \numsecentry
@@ -6828,8 +6895,6 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6828 % This space should be enough, since a single number is .5em, and the 6895 % This space should be enough, since a single number is .5em, and the
6829 % widest letter (M) is 1em, at least in the Computer Modern fonts. 6896 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6830 % But use \hss just in case. 6897 % But use \hss just in case.
6831 % (This space doesn't include the extra space that gets added after
6832 % the label; that gets put in by \shortchapentry above.)
6833 % 6898 %
6834 % We'd like to right-justify chapter numbers, but that looks strange 6899 % We'd like to right-justify chapter numbers, but that looks strange
6835 % with appendix letters. And right-justifying numbers and 6900 % with appendix letters. And right-justifying numbers and
@@ -6839,10 +6904,15 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6839 \hbox to 1em{#1\hss}% 6904 \hbox to 1em{#1\hss}%
6840} 6905}
6841 6906
6842% These macros generate individual entries in the table of contents. 6907% These macros generate individual entries in the table of contents,
6843% The first argument is the chapter or section name. 6908% and are read in from the *.toc file.
6844% The last argument is the page number. 6909%
6845% The arguments in between are the chapter number, section number, ... 6910% The arguments are like:
6911% \def\numchapentry#1#2#3#4
6912% #1 - the chapter or section name.
6913% #2 - section number
6914% #3 - level of section (e.g "chap", "sec")
6915% #4 - page number
6846 6916
6847% Parts, in the main contents. Replace the part number, which doesn't 6917% Parts, in the main contents. Replace the part number, which doesn't
6848% exist, with an empty box. Let's hope all the numbers have the same width. 6918% exist, with an empty box. Let's hope all the numbers have the same width.
@@ -6855,7 +6925,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6855 \vskip 0pt plus 5\baselineskip 6925 \vskip 0pt plus 5\baselineskip
6856 \penalty-300 6926 \penalty-300
6857 \vskip 0pt plus -5\baselineskip 6927 \vskip 0pt plus -5\baselineskip
6858 \dochapentry{\numeralbox\labelspace#1}{}% 6928 \dochapentry{#1}{\numeralbox}{}%
6859} 6929}
6860% 6930%
6861% Parts, in the short toc. 6931% Parts, in the short toc.
@@ -6866,12 +6936,14 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6866} 6936}
6867 6937
6868% Chapters, in the main contents. 6938% Chapters, in the main contents.
6869\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} 6939\def\numchapentry#1#2#3#4{%
6940 \retrievesecnowidth\secnowidthchap{#2}%
6941 \dochapentry{#1}{#2}{#4}%
6942}
6870 6943
6871% Chapters, in the short toc. 6944% Chapters, in the short toc.
6872% See comments in \dochapentry re vbox and related settings.
6873\def\shortchapentry#1#2#3#4{% 6945\def\shortchapentry#1#2#3#4{%
6874 \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}% 6946 \tocentry{#1}{\shortchaplabel{#2}}{#4}%
6875} 6947}
6876 6948
6877% Appendices, in the main contents. 6949% Appendices, in the main contents.
@@ -6882,67 +6954,111 @@ might help (with 'rm \jobname.?? \jobname.??s')%
6882 \setbox0 = \hbox{\putwordAppendix{} M}% 6954 \setbox0 = \hbox{\putwordAppendix{} M}%
6883 \hbox to \wd0{\putwordAppendix{} #1\hss}} 6955 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6884% 6956%
6885\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} 6957\def\appentry#1#2#3#4{%
6958 \retrievesecnowidth\secnowidthchap{#2}%
6959 \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#4}%
6960}
6886 6961
6887% Unnumbered chapters. 6962% Unnumbered chapters.
6888\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} 6963\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#4}}
6889\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}} 6964\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#4}}
6890 6965
6891% Sections. 6966% Sections.
6892\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} 6967\def\numsecentry#1#2#3#4{\dosecentry{#1}{#2}{#4}}
6968
6969\def\numsecentry#1#2#3#4{%
6970 \retrievesecnowidth\secnowidthsec{#2}%
6971 \dosecentry{#1}{#2}{#4}%
6972}
6893\let\appsecentry=\numsecentry 6973\let\appsecentry=\numsecentry
6894\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} 6974\def\unnsecentry#1#2#3#4{%
6975 \retrievesecnowidth\secnowidthsec{#2}%
6976 \dosecentry{#1}{}{#4}%
6977}
6895 6978
6896% Subsections. 6979% Subsections.
6897\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} 6980\def\numsubsecentry#1#2#3#4{%
6981 \retrievesecnowidth\secnowidthssec{#2}%
6982 \dosubsecentry{#1}{#2}{#4}%
6983}
6898\let\appsubsecentry=\numsubsecentry 6984\let\appsubsecentry=\numsubsecentry
6899\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} 6985\def\unnsubsecentry#1#2#3#4{%
6986 \retrievesecnowidth\secnowidthssec{#2}%
6987 \dosubsecentry{#1}{}{#4}%
6988}
6900 6989
6901% And subsubsections. 6990% And subsubsections.
6902\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} 6991\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#4}}
6903\let\appsubsubsecentry=\numsubsubsecentry 6992\let\appsubsubsecentry=\numsubsubsecentry
6904\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} 6993\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#4}}
6905 6994
6906% This parameter controls the indentation of the various levels. 6995% This parameter controls the indentation of the various levels.
6907% Same as \defaultparindent. 6996% Same as \defaultparindent.
6908\newdimen\tocindent \tocindent = 15pt 6997\newdimen\tocindent \tocindent = 15pt
6909 6998
6910% Now for the actual typesetting. In all these, #1 is the text and #2 is the 6999% Now for the actual typesetting. In all these, #1 is the text, #2 is
6911% page number. 7000% a section number if present, and #3 is the page number.
6912% 7001%
6913% If the toc has to be broken over pages, we want it to be at chapters 7002% If the toc has to be broken over pages, we want it to be at chapters
6914% if at all possible; hence the \penalty. 7003% if at all possible; hence the \penalty.
6915\def\dochapentry#1#2{% 7004\def\dochapentry#1#2#3{%
6916 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip 7005 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6917 \begingroup 7006 \begingroup
6918 % Move the page numbers slightly to the right 7007 % Move the page numbers slightly to the right
6919 \advance\entryrightmargin by -0.05em 7008 \advance\entryrightmargin by -0.05em
6920 \chapentryfonts 7009 \chapentryfonts
6921 \tocentry{#1}{#2}% 7010 \extrasecnoskip=0.4em % separate chapter number more
7011 \tocentry{#1}{#2}{#3}%
6922 \endgroup 7012 \endgroup
6923 \nobreak\vskip .25\baselineskip plus.1\baselineskip 7013 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6924} 7014}
6925 7015
6926\def\dosecentry#1#2{\begingroup 7016\def\dosecentry#1#2#3{\begingroup
7017 \secnowidth=\secnowidthchap
6927 \secentryfonts \leftskip=\tocindent 7018 \secentryfonts \leftskip=\tocindent
6928 \tocentry{#1}{#2}% 7019 \tocentry{#1}{#2}{#3}%
6929\endgroup} 7020\endgroup}
6930 7021
6931\def\dosubsecentry#1#2{\begingroup 7022\def\dosubsecentry#1#2#3{\begingroup
7023 \secnowidth=\secnowidthsec
6932 \subsecentryfonts \leftskip=2\tocindent 7024 \subsecentryfonts \leftskip=2\tocindent
6933 \tocentry{#1}{#2}% 7025 \tocentry{#1}{#2}{#3}%
6934\endgroup} 7026\endgroup}
6935 7027
6936\def\dosubsubsecentry#1#2{\begingroup 7028\def\dosubsubsecentry#1#2#3{\begingroup
7029 \secnowidth=\secnowidthssec
6937 \subsubsecentryfonts \leftskip=3\tocindent 7030 \subsubsecentryfonts \leftskip=3\tocindent
6938 \tocentry{#1}{#2}% 7031 \tocentry{#1}{#2}{#3}%
6939\endgroup} 7032\endgroup}
6940 7033
6941% We use the same \entry macro as for the index entries. 7034% Used for the maximum width of a section number so we can align
6942\let\tocentry = \entry 7035% section titles.
7036\newdimen\secnowidth
7037\secnowidth=0pt
7038\newdimen\extrasecnoskip
7039\extrasecnoskip=0pt
6943 7040
6944% Space between chapter (or whatever) number and the title. 7041% \tocentry{TITLE}{SEC NO}{PAGE}
6945\def\labelspace{\hskip1em \relax} 7042%
7043\def\tocentry#1#2#3{%
7044 \def\secno{#2}%
7045 \ifx\empty\secno
7046 \entry{#1}{#3}%
7047 \else
7048 \ifdim 0pt=\secnowidth
7049 \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}%
7050 \else
7051 \advance\secnowidth by \labelspace
7052 \advance\secnowidth by \extrasecnoskip
7053 \setbox0=\hbox to \secnowidth{%
7054 #2\hskip\labelspace\hskip\extrasecnoskip\hfill}%
7055 \fi
7056 \entrycontskip=\wd0
7057 \entry{\box0 #1}{#3}%
7058 \fi
7059}
7060\newdimen\labelspace
7061\labelspace=0.6em
6946 7062
6947\def\chapentryfonts{\secfonts \rm} 7063\def\chapentryfonts{\secfonts \rm}
6948\def\secentryfonts{\textfonts} 7064\def\secentryfonts{\textfonts}
@@ -7787,6 +7903,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
7787 \tolerance=10000 \hbadness=10000 7903 \tolerance=10000 \hbadness=10000
7788 \exdentamount=\defbodyindent 7904 \exdentamount=\defbodyindent
7789 {% 7905 {%
7906 \def\^^M{}% for line continuation
7907 %
7790 % defun fonts. We use typewriter by default (used to be bold) because: 7908 % defun fonts. We use typewriter by default (used to be bold) because:
7791 % . we're printing identifiers, they should be in tt in principle. 7909 % . we're printing identifiers, they should be in tt in principle.
7792 % . in languages with many accents, such as Czech or French, it's 7910 % . in languages with many accents, such as Czech or French, it's
@@ -7819,6 +7937,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
7819% Print arguments. Use slanted for @def*, typewriter for @deftype*. 7937% Print arguments. Use slanted for @def*, typewriter for @deftype*.
7820\def\defunargs#1{% 7938\def\defunargs#1{%
7821 \bgroup 7939 \bgroup
7940 \def\^^M{}% for line continuation
7822 \df \ifdoingtypefn \tt \else \sl \fi 7941 \df \ifdoingtypefn \tt \else \sl \fi
7823 \ifflagclear{txicodevaristt}{}% 7942 \ifflagclear{txicodevaristt}{}%
7824 {\def\var##1{{\setregularquotes \ttsl ##1}}}% 7943 {\def\var##1{{\setregularquotes \ttsl ##1}}}%
diff --git a/lib/diffseq.h b/lib/diffseq.h
index 06e1465bf1b..3f85ab2ec41 100644
--- a/lib/diffseq.h
+++ b/lib/diffseq.h
@@ -92,20 +92,11 @@
92# define NOTE_ORDERED false 92# define NOTE_ORDERED false
93#endif 93#endif
94 94
95/* Use this to suppress gcc's "...may be used before initialized" warnings. 95/* Suppress gcc's "...may be used before initialized" warnings,
96 Beware: The Code argument must not contain commas. */ 96 generated by GCC versions up to at least GCC 13.2. */
97#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4 97#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
98# pragma GCC diagnostic push 98# pragma GCC diagnostic push
99#endif 99# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
100#ifndef IF_LINT
101# if defined GCC_LINT || defined lint
102# define IF_LINT(Code) Code
103# else
104# define IF_LINT(Code) /* empty */
105# if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
106# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
107# endif
108# endif
109#endif 100#endif
110 101
111/* 102/*
@@ -388,13 +379,8 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
388 and report halfway between our best results so far. */ 379 and report halfway between our best results so far. */
389 if (c >= ctxt->too_expensive) 380 if (c >= ctxt->too_expensive)
390 { 381 {
391 OFFSET fxybest;
392 OFFSET fxbest IF_LINT (= 0);
393 OFFSET bxybest;
394 OFFSET bxbest IF_LINT (= 0);
395
396 /* Find forward diagonal that maximizes X + Y. */ 382 /* Find forward diagonal that maximizes X + Y. */
397 fxybest = -1; 383 OFFSET fxybest = -1, fxbest;
398 for (d = fmax; d >= fmin; d -= 2) 384 for (d = fmax; d >= fmin; d -= 2)
399 { 385 {
400 OFFSET x = MIN (fd[d], xlim); 386 OFFSET x = MIN (fd[d], xlim);
@@ -412,7 +398,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
412 } 398 }
413 399
414 /* Find backward diagonal that minimizes X + Y. */ 400 /* Find backward diagonal that minimizes X + Y. */
415 bxybest = OFFSET_MAX; 401 OFFSET bxybest = OFFSET_MAX, bxbest;
416 for (d = bmax; d >= bmin; d -= 2) 402 for (d = bmax; d >= bmin; d -= 2)
417 { 403 {
418 OFFSET x = MAX (xoff, bd[d]); 404 OFFSET x = MAX (xoff, bd[d]);
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 1bfa1daa0b3..78ecb544c6e 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -41,6 +41,10 @@
41# --avoid=dup \ 41# --avoid=dup \
42# --avoid=fchdir \ 42# --avoid=fchdir \
43# --avoid=fstat \ 43# --avoid=fstat \
44# --avoid=iswblank \
45# --avoid=iswctype \
46# --avoid=iswdigit \
47# --avoid=iswxdigit \
44# --avoid=langinfo \ 48# --avoid=langinfo \
45# --avoid=lock \ 49# --avoid=lock \
46# --avoid=mbrtowc \ 50# --avoid=mbrtowc \
@@ -67,6 +71,7 @@
67# --avoid=utime-h \ 71# --avoid=utime-h \
68# --avoid=wchar \ 72# --avoid=wchar \
69# --avoid=wcrtomb \ 73# --avoid=wcrtomb \
74# --avoid=wctype \
70# --avoid=wctype-h \ 75# --avoid=wctype-h \
71# alignasof \ 76# alignasof \
72# alloca-opt \ 77# alloca-opt \
@@ -658,7 +663,6 @@ GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
658GMALLOC_OBJ = @GMALLOC_OBJ@ 663GMALLOC_OBJ = @GMALLOC_OBJ@
659GMP_H = @GMP_H@ 664GMP_H = @GMP_H@
660GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@ 665GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
661GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
662GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@ 666GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
663GNUSTEP_CFLAGS = @GNUSTEP_CFLAGS@ 667GNUSTEP_CFLAGS = @GNUSTEP_CFLAGS@
664GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@ 668GNU_OBJC_CFLAGS = @GNU_OBJC_CFLAGS@
diff --git a/lib/time.in.h b/lib/time.in.h
index 06428adb1d0..06824da9d3d 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -143,6 +143,12 @@ _GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
143# if __GLIBC__ >= 2 143# if __GLIBC__ >= 2
144_GL_CXXALIASWARN (timespec_get); 144_GL_CXXALIASWARN (timespec_get);
145# endif 145# endif
146# elif defined GNULIB_POSIXCHECK
147# undef timespec_get
148# if HAVE_RAW_DECL_TIMESPEC_GET
149_GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - "
150 "use gnulib module timespec_get for portability");
151# endif
146# endif 152# endif
147 153
148/* Set *TS to the current time resolution, and return BASE. 154/* Set *TS to the current time resolution, and return BASE.
@@ -154,6 +160,12 @@ _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base)
154# endif 160# endif
155_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); 161_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
156_GL_CXXALIASWARN (timespec_getres); 162_GL_CXXALIASWARN (timespec_getres);
163# elif defined GNULIB_POSIXCHECK
164# undef timespec_getres
165# if HAVE_RAW_DECL_TIMESPEC_GETRES
166_GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - "
167 "use gnulib module timespec_getres for portability");
168# endif
157# endif 169# endif
158 170
159/* Return the number of seconds that have elapsed since the Epoch. */ 171/* Return the number of seconds that have elapsed since the Epoch. */
@@ -170,6 +182,12 @@ _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
170# if __GLIBC__ >= 2 182# if __GLIBC__ >= 2
171_GL_CXXALIASWARN (time); 183_GL_CXXALIASWARN (time);
172# endif 184# endif
185# elif defined GNULIB_POSIXCHECK
186# undef time
187# if HAVE_RAW_DECL_TIME
188_GL_WARN_ON_USE (time, "time has consistency problems - "
189 "use gnulib module time for portability");
190# endif
173# endif 191# endif
174 192
175/* Sleep for at least RQTP seconds unless interrupted, If interrupted, 193/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
@@ -195,6 +213,12 @@ _GL_CXXALIAS_SYS (nanosleep, int,
195 (struct timespec const *__rqtp, struct timespec *__rmtp)); 213 (struct timespec const *__rqtp, struct timespec *__rmtp));
196# endif 214# endif
197_GL_CXXALIASWARN (nanosleep); 215_GL_CXXALIASWARN (nanosleep);
216# elif defined GNULIB_POSIXCHECK
217# undef nanosleep
218# if HAVE_RAW_DECL_NANOSLEEP
219_GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - "
220 "use gnulib module nanosleep for portability");
221# endif
198# endif 222# endif
199 223
200/* Initialize time conversion information. */ 224/* Initialize time conversion information. */
@@ -230,6 +254,12 @@ _GL_CXXALIAS_MDA (tzset, void, (void));
230_GL_CXXALIAS_SYS (tzset, void, (void)); 254_GL_CXXALIAS_SYS (tzset, void, (void));
231# endif 255# endif
232_GL_CXXALIASWARN (tzset); 256_GL_CXXALIASWARN (tzset);
257# elif defined GNULIB_POSIXCHECK
258# undef tzset
259# if HAVE_RAW_DECL_TZSET
260_GL_WARN_ON_USE (tzset, "tzset has portability problems - "
261 "use gnulib module tzset for portability");
262# endif
233# endif 263# endif
234 264
235/* Return the 'time_t' representation of TP and normalize TP. */ 265/* Return the 'time_t' representation of TP and normalize TP. */
@@ -246,6 +276,12 @@ _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
246# if __GLIBC__ >= 2 276# if __GLIBC__ >= 2
247_GL_CXXALIASWARN (mktime); 277_GL_CXXALIASWARN (mktime);
248# endif 278# endif
279# elif defined GNULIB_POSIXCHECK
280# undef mktime
281# if HAVE_RAW_DECL_MKTIME
282_GL_WARN_ON_USE (mktime, "mktime has portability problems - "
283 "use gnulib module mktime for portability");
284# endif
249# endif 285# endif
250 286
251/* Convert TIMER to RESULT, assuming local time and UTC respectively. See 287/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
@@ -296,6 +332,17 @@ _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
296# if @HAVE_DECL_LOCALTIME_R@ 332# if @HAVE_DECL_LOCALTIME_R@
297_GL_CXXALIASWARN (gmtime_r); 333_GL_CXXALIASWARN (gmtime_r);
298# endif 334# endif
335# elif defined GNULIB_POSIXCHECK
336# undef localtime_r
337# if HAVE_RAW_DECL_LOCALTIME_R
338_GL_WARN_ON_USE (localtime_r, "localtime_r is unportable - "
339 "use gnulib module time_r for portability");
340# endif
341# undef gmtime_r
342# if HAVE_RAW_DECL_GMTIME_R
343_GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - "
344 "use gnulib module time_r for portability");
345# endif
299# endif 346# endif
300 347
301/* Convert TIMER to RESULT, assuming local time and UTC respectively. See 348/* Convert TIMER to RESULT, assuming local time and UTC respectively. See
@@ -316,6 +363,12 @@ _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
316# if __GLIBC__ >= 2 363# if __GLIBC__ >= 2
317_GL_CXXALIASWARN (localtime); 364_GL_CXXALIASWARN (localtime);
318# endif 365# endif
366# elif defined GNULIB_POSIXCHECK
367# undef localtime
368# if HAVE_RAW_DECL_LOCALTIME
369_GL_WARN_ON_USE (localtime, "localtime has portability problems - "
370 "use gnulib module localtime for portability");
371# endif
319# endif 372# endif
320 373
321# if 0 || @REPLACE_GMTIME@ 374# if 0 || @REPLACE_GMTIME@
@@ -347,6 +400,12 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
347 char const *restrict __format, 400 char const *restrict __format,
348 struct tm *restrict __tm)); 401 struct tm *restrict __tm));
349_GL_CXXALIASWARN (strptime); 402_GL_CXXALIASWARN (strptime);
403# elif defined GNULIB_POSIXCHECK
404# undef strptime
405# if HAVE_RAW_DECL_STRPTIME
406_GL_WARN_ON_USE (strptime, "strptime is unportable - "
407 "use gnulib module strptime for portability");
408# endif
350# endif 409# endif
351 410
352/* Convert *TP to a date and time string. See 411/* Convert *TP to a date and time string. See
@@ -368,6 +427,12 @@ _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
368# if __GLIBC__ >= 2 427# if __GLIBC__ >= 2
369_GL_CXXALIASWARN (ctime); 428_GL_CXXALIASWARN (ctime);
370# endif 429# endif
430# elif defined GNULIB_POSIXCHECK
431# undef ctime
432# if HAVE_RAW_DECL_CTIME
433_GL_WARN_ON_USE (ctime, "ctime has portability problems - "
434 "use gnulib module ctime for portability");
435# endif
371# endif 436# endif
372 437
373/* Convert *TP to a date and time string. See 438/* Convert *TP to a date and time string. See
@@ -392,6 +457,12 @@ _GL_CXXALIAS_SYS (strftime, size_t,
392# if __GLIBC__ >= 2 457# if __GLIBC__ >= 2
393_GL_CXXALIASWARN (strftime); 458_GL_CXXALIASWARN (strftime);
394# endif 459# endif
460# elif defined GNULIB_POSIXCHECK
461# undef strftime
462# if HAVE_RAW_DECL_STRFTIME
463_GL_WARN_ON_USE (strftime, "strftime has portability problems - "
464 "use gnulib module strftime-fixes for portability");
465# endif
395# endif 466# endif
396 467
397# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@ 468# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
@@ -469,6 +540,12 @@ _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
469# if __GLIBC__ >= 2 540# if __GLIBC__ >= 2
470_GL_CXXALIASWARN (timegm); 541_GL_CXXALIASWARN (timegm);
471# endif 542# endif
543# elif defined GNULIB_POSIXCHECK
544# undef timegm
545# if HAVE_RAW_DECL_TIMEGM
546_GL_WARN_ON_USE (timegm, "timegm is unportable - "
547 "use gnulib module timegm for portability");
548# endif
472# endif 549# endif
473 550
474/* Encourage applications to avoid unsafe functions that can overrun 551/* Encourage applications to avoid unsafe functions that can overrun
@@ -476,8 +553,10 @@ _GL_CXXALIASWARN (timegm);
476 applications should use strftime (or even sprintf) instead. */ 553 applications should use strftime (or even sprintf) instead. */
477# if defined GNULIB_POSIXCHECK 554# if defined GNULIB_POSIXCHECK
478# undef asctime 555# undef asctime
556# if HAVE_RAW_DECL_ASCTIME
479_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " 557_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
480 "better use strftime (or even sprintf) instead"); 558 "better use strftime (or even sprintf) instead");
559# endif
481# endif 560# endif
482# if defined GNULIB_POSIXCHECK 561# if defined GNULIB_POSIXCHECK
483# undef asctime_r 562# undef asctime_r
@@ -488,8 +567,10 @@ _GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
488# endif 567# endif
489# if defined GNULIB_POSIXCHECK 568# if defined GNULIB_POSIXCHECK
490# undef ctime 569# undef ctime
570# if HAVE_RAW_DECL_CTIME
491_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - " 571_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
492 "better use strftime (or even sprintf) instead"); 572 "better use strftime (or even sprintf) instead");
573# endif
493# endif 574# endif
494# if defined GNULIB_POSIXCHECK 575# if defined GNULIB_POSIXCHECK
495# undef ctime_r 576# undef ctime_r
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
index d624a73d35d..28534db1c76 100644
--- a/m4/clock_time.m4
+++ b/m4/clock_time.m4
@@ -1,4 +1,4 @@
1# clock_time.m4 serial 12 1# clock_time.m4 serial 13
2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. 2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -12,9 +12,17 @@ dnl with or without modifications, as long as this notice is preserved.
12 12
13AC_DEFUN([gl_CLOCK_TIME], 13AC_DEFUN([gl_CLOCK_TIME],
14[ 14[
15 AC_REQUIRE([AC_CANONICAL_HOST])
16
15 dnl Persuade glibc and Solaris <time.h> to declare these functions. 17 dnl Persuade glibc and Solaris <time.h> to declare these functions.
16 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 18 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
17 19
20 # On mingw, these functions are defined in the libwinpthread library,
21 # which is better avoided. In fact, the clock_gettime function is buggy
22 # in 32-bit mingw, when -D__MINGW_USE_VC2005_COMPAT is used (which Gnulib's
23 # year2038 module does): It leaves the upper 32 bits of the tv_sec field
24 # of the result uninitialized.
25
18 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. 26 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
19 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. 27 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
20 28
@@ -23,12 +31,22 @@ AC_DEFUN([gl_CLOCK_TIME],
23 # library, inducing unnecessary run-time overhead. 31 # library, inducing unnecessary run-time overhead.
24 CLOCK_TIME_LIB= 32 CLOCK_TIME_LIB=
25 AC_SUBST([CLOCK_TIME_LIB]) 33 AC_SUBST([CLOCK_TIME_LIB])
26 gl_saved_libs=$LIBS 34 case "$host_os" in
27 AC_SEARCH_LIBS([clock_gettime], [rt posix4], 35 mingw*)
28 [test "$ac_cv_search_clock_gettime" = "none required" || 36 ac_cv_func_clock_getres=no
29 CLOCK_TIME_LIB=$ac_cv_search_clock_gettime]) 37 ac_cv_func_clock_gettime=no
30 AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime]) 38 ac_cv_func_clock_settime=no
31 LIBS=$gl_saved_libs 39 ;;
40 *)
41 gl_saved_libs=$LIBS
42 AC_SEARCH_LIBS([clock_gettime], [rt posix4],
43 [test "$ac_cv_search_clock_gettime" = "none required" ||
44 CLOCK_TIME_LIB=$ac_cv_search_clock_gettime])
45 AC_CHECK_FUNCS([clock_getres clock_gettime clock_settime])
46 LIBS=$gl_saved_libs
47 ;;
48 esac
49
32 # For backward compatibility. 50 # For backward compatibility.
33 LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB" 51 LIB_CLOCK_GETTIME="$CLOCK_TIME_LIB"
34 AC_SUBST([LIB_CLOCK_GETTIME]) 52 AC_SUBST([LIB_CLOCK_GETTIME])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index e9d31f35a46..69cce86da5a 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 37 1# serial 38
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -280,7 +280,6 @@ AC_DEFUN([gl_FUNC_MKTIME],
280 AC_REQUIRE([AC_CANONICAL_HOST]) 280 AC_REQUIRE([AC_CANONICAL_HOST])
281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
282 282
283 REPLACE_MKTIME=0
284 if test "$gl_cv_func_working_mktime" != yes; then 283 if test "$gl_cv_func_working_mktime" != yes; then
285 REPLACE_MKTIME=1 284 REPLACE_MKTIME=1
286 AC_DEFINE([NEED_MKTIME_WORKING], [1], 285 AC_DEFINE([NEED_MKTIME_WORKING], [1],
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
index e21a3e343cb..b7f22d7b606 100644
--- a/m4/nanosleep.m4
+++ b/m4/nanosleep.m4
@@ -1,4 +1,4 @@
1# serial 43 1# serial 44
2 2
3dnl From Jim Meyering. 3dnl From Jim Meyering.
4dnl Check for the nanosleep function. 4dnl Check for the nanosleep function.
@@ -126,9 +126,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP],
126 ]) 126 ])
127 ]) 127 ])
128 case "$gl_cv_func_nanosleep" in 128 case "$gl_cv_func_nanosleep" in
129 *yes) 129 *yes) ;;
130 REPLACE_NANOSLEEP=0
131 ;;
132 *) 130 *)
133 REPLACE_NANOSLEEP=1 131 REPLACE_NANOSLEEP=1
134 case "$gl_cv_func_nanosleep" in 132 case "$gl_cv_func_nanosleep" in
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index 1a236d66d2f..6a39ffe7565 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -68,8 +68,10 @@ AC_DEFUN([gl_ALIGNASOF],
68 dnl The "zz" puts this toward config.h's end, to avoid potential 68 dnl The "zz" puts this toward config.h's end, to avoid potential
69 dnl collisions with other definitions. 69 dnl collisions with other definitions.
70 AH_VERBATIM([zzalignas], 70 AH_VERBATIM([zzalignas],
71[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof 71[#if !defined HAVE_C_ALIGNASOF \
72# if HAVE_STDALIGN_H 72 && !(defined __cplusplus && 201103 <= __cplusplus) \
73 && !defined alignof
74# if defined HAVE_STDALIGN_H
73# include <stdalign.h> 75# include <stdalign.h>
74# endif 76# endif
75 77
@@ -166,7 +168,7 @@ AC_DEFUN([gl_ALIGNASOF],
166# define _Alignas(a) __declspec (align (a)) 168# define _Alignas(a) __declspec (align (a))
167# endif 169# endif
168# endif 170# endif
169# if !HAVE_STDALIGN_H 171# if !defined HAVE_STDALIGN_H
170# if ((defined _Alignas \ 172# if ((defined _Alignas \
171 && !(defined __cplusplus \ 173 && !(defined __cplusplus \
172 && (201103 <= __cplusplus || defined _MSC_VER))) \ 174 && (201103 <= __cplusplus || defined _MSC_VER))) \
@@ -175,7 +177,7 @@ AC_DEFUN([gl_ALIGNASOF],
175# endif 177# endif
176# endif 178# endif
177 179
178# if _GL_STDALIGN_NEEDS_STDDEF 180# if defined _GL_STDALIGN_NEEDS_STDDEF
179# include <stddef.h> 181# include <stddef.h>
180# endif 182# endif
181#endif]) 183#endif])
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index 51d553a2f1a..632d18fc071 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -2,7 +2,7 @@
2 2
3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc.
4 4
5# serial 22 5# serial 24
6 6
7# This file is free software; the Free Software Foundation 7# This file is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it, 8# gives unlimited permission to copy and/or distribute it,
@@ -23,7 +23,10 @@ AC_DEFUN_ONCE([gl_TIME_H],
23 dnl corresponding gnulib module is not in use. 23 dnl corresponding gnulib module is not in use.
24 gl_WARN_ON_USE_PREPARE([[ 24 gl_WARN_ON_USE_PREPARE([[
25#include <time.h> 25#include <time.h>
26 ]], [asctime_r ctime_r]) 26 ]], [
27 asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime
28 nanosleep strftime strptime time timegm timespec_get timespec_getres tzset
29 ])
27 30
28 AC_REQUIRE([AC_C_RESTRICT]) 31 AC_REQUIRE([AC_C_RESTRICT])
29 32
@@ -162,25 +165,15 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
162 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) 165 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
163 dnl Even GNU libc does not have timezone_t yet. 166 dnl Even GNU libc does not have timezone_t yet.
164 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) 167 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
165 dnl If another module says to replace or to not replace, do that. 168 REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME])
166 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
167 dnl this lets maintainers check for portability.
168 REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
169 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
170 REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
171 REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
172 REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
173 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
174 REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
175 REPLACE_TIMESPEC_GET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMESPEC_GET])
176 REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
177
178 dnl Hack so that the time module doesn't depend on the sys_time module.
179 dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
180 : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
181 dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
182 dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
183 dnl is no longer a big deal.
184 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) 169 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
185 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) 170 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
171 REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R])
172 REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME])
173 REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP])
174 REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME])
175 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
176 REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
177 REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
178 REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
186]) 179])
diff --git a/m4/time_r.m4 b/m4/time_r.m4
index adce438abf1..4831eb26f90 100644
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -57,9 +57,7 @@ AC_DEFUN([gl_TIME_R],
57 [gl_cv_time_r_posix=yes], 57 [gl_cv_time_r_posix=yes],
58 [gl_cv_time_r_posix=no]) 58 [gl_cv_time_r_posix=no])
59 ]) 59 ])
60 if test $gl_cv_time_r_posix = yes; then 60 if test $gl_cv_time_r_posix != yes; then
61 REPLACE_LOCALTIME_R=0
62 else
63 REPLACE_LOCALTIME_R=1 61 REPLACE_LOCALTIME_R=1
64 fi 62 fi
65 else 63 else
diff --git a/m4/timegm.m4 b/m4/timegm.m4
index 8ab265e65fe..6da07807698 100644
--- a/m4/timegm.m4
+++ b/m4/timegm.m4
@@ -1,4 +1,4 @@
1# timegm.m4 serial 15 1# timegm.m4 serial 16
2dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. 2dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,6 @@ AC_DEFUN([gl_FUNC_TIMEGM],
8[ 8[
9 AC_REQUIRE([gl_TIME_H_DEFAULTS]) 9 AC_REQUIRE([gl_TIME_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 10 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
11 REPLACE_TIMEGM=0
12 gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]]) 11 gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]])
13 if test $ac_cv_func_timegm = yes; then 12 if test $ac_cv_func_timegm = yes; then
14 if test "$gl_cv_func_working_mktime" != yes; then 13 if test "$gl_cv_func_working_mktime" != yes; then
diff --git a/src/Makefile.in b/src/Makefile.in
index e818b6c1655..b14681f2537 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -167,7 +167,7 @@ CLOCK_TIME_LIB=@CLOCK_TIME_LIB@
167EUIDACCESS_LIBGEN=@EUIDACCESS_LIBGEN@ 167EUIDACCESS_LIBGEN=@EUIDACCESS_LIBGEN@
168NANOSLEEP_LIB=@NANOSLEEP_LIB@ 168NANOSLEEP_LIB=@NANOSLEEP_LIB@
169QCOPY_ACL_LIB=@QCOPY_ACL_LIB@ 169QCOPY_ACL_LIB=@QCOPY_ACL_LIB@
170LIB_TIMER_TIME=@LIB_TIMER_TIME@ 170TIMER_TIME_LIB=@TIMER_TIME_LIB@
171 171
172DBUS_CFLAGS = @DBUS_CFLAGS@ 172DBUS_CFLAGS = @DBUS_CFLAGS@
173DBUS_LIBS = @DBUS_LIBS@ 173DBUS_LIBS = @DBUS_LIBS@
@@ -596,7 +596,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(PGTK_LIBS) $(LIBX_BASE) $(LIBIMAGE
596 $(LIBX_OTHER) $(LIBSOUND) \ 596 $(LIBX_OTHER) $(LIBSOUND) \
597 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(CLOCK_TIME_LIB) \ 597 $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(CLOCK_TIME_LIB) \
598 $(NANOSLEEP_LIB) $(QCOPY_ACL_LIB) $(WEBKIT_LIBS) \ 598 $(NANOSLEEP_LIB) $(QCOPY_ACL_LIB) $(WEBKIT_LIBS) \
599 $(EUIDACCESS_LIBGEN) $(LIB_TIMER_TIME) $(DBUS_LIBS) \ 599 $(EUIDACCESS_LIBGEN) $(TIMER_TIME_LIB) $(DBUS_LIBS) \
600 $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \ 600 $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) $(XFIXES_LIBS) \
601 $(XDBE_LIBS) $(XSYNC_LIBS) \ 601 $(XDBE_LIBS) $(XSYNC_LIBS) \
602 $(LIBXML2_LIBS) $(LIBGPM) $(LIBS_SYSTEM) $(CAIRO_LIBS) \ 602 $(LIBXML2_LIBS) $(LIBGPM) $(LIBS_SYSTEM) $(CAIRO_LIBS) \