aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2023-08-12 12:50:15 -0700
committerPaul Eggert2023-08-12 12:57:35 -0700
commitf3868cb9d1806b35186eabc0262393316ebe689a (patch)
treeb94176760150b6994aacf74292a12ba0890b9222 /lib
parentb66c16c789d8046ff40c48b9346b26238b1b97e1 (diff)
downloademacs-f3868cb9d1806b35186eabc0262393316ebe689a.tar.gz
emacs-f3868cb9d1806b35186eabc0262393316ebe689a.zip
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'lib')
-rw-r--r--lib/diffseq.h24
-rw-r--r--lib/gnulib.mk.in6
-rw-r--r--lib/time.in.h81
3 files changed, 91 insertions, 20 deletions
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