summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-08-12 12:50:15 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2023-08-12 12:57:35 -0700
commitf3868cb9d1806b35186eabc0262393316ebe689a (patch)
treeb94176760150b6994aacf74292a12ba0890b9222 /lib
parentb66c16c789d8046ff40c48b9346b26238b1b97e1 (diff)
downloademacs-f3868cb9d1806b35186eabc0262393316ebe689a.tar.gz
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 @@
# define NOTE_ORDERED false
#endif
-/* Use this to suppress gcc's "...may be used before initialized" warnings.
- Beware: The Code argument must not contain commas. */
+/* Suppress gcc's "...may be used before initialized" warnings,
+ generated by GCC versions up to at least GCC 13.2. */
#if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
# pragma GCC diagnostic push
-#endif
-#ifndef IF_LINT
-# if defined GCC_LINT || defined lint
-# define IF_LINT(Code) Code
-# else
-# define IF_LINT(Code) /* empty */
-# if __GNUC__ + (__GNUC_MINOR__ >= 7) > 4
-# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-# endif
-# endif
+# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
/*
@@ -388,13 +379,8 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
and report halfway between our best results so far. */
if (c >= ctxt->too_expensive)
{
- OFFSET fxybest;
- OFFSET fxbest IF_LINT (= 0);
- OFFSET bxybest;
- OFFSET bxbest IF_LINT (= 0);
-
/* Find forward diagonal that maximizes X + Y. */
- fxybest = -1;
+ OFFSET fxybest = -1, fxbest;
for (d = fmax; d >= fmin; d -= 2)
{
OFFSET x = MIN (fd[d], xlim);
@@ -412,7 +398,7 @@ diag (OFFSET xoff, OFFSET xlim, OFFSET yoff, OFFSET ylim, bool find_minimal,
}
/* Find backward diagonal that minimizes X + Y. */
- bxybest = OFFSET_MAX;
+ OFFSET bxybest = OFFSET_MAX, bxbest;
for (d = bmax; d >= bmin; d -= 2)
{
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 @@
# --avoid=dup \
# --avoid=fchdir \
# --avoid=fstat \
+# --avoid=iswblank \
+# --avoid=iswctype \
+# --avoid=iswdigit \
+# --avoid=iswxdigit \
# --avoid=langinfo \
# --avoid=lock \
# --avoid=mbrtowc \
@@ -67,6 +71,7 @@
# --avoid=utime-h \
# --avoid=wchar \
# --avoid=wcrtomb \
+# --avoid=wctype \
# --avoid=wctype-h \
# alignasof \
# alloca-opt \
@@ -658,7 +663,6 @@ GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
GMALLOC_OBJ = @GMALLOC_OBJ@
GMP_H = @GMP_H@
GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
-GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
GNULIB_WARN_CFLAGS = @GNULIB_WARN_CFLAGS@
GNUSTEP_CFLAGS = @GNUSTEP_CFLAGS@
GNU_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));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (timespec_get);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef timespec_get
+# if HAVE_RAW_DECL_TIMESPEC_GET
+_GL_WARN_ON_USE (timespec_get, "timespec_get is unportable - "
+ "use gnulib module timespec_get for portability");
+# endif
# endif
/* 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)
# endif
_GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base));
_GL_CXXALIASWARN (timespec_getres);
+# elif defined GNULIB_POSIXCHECK
+# undef timespec_getres
+# if HAVE_RAW_DECL_TIMESPEC_GETRES
+_GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - "
+ "use gnulib module timespec_getres for portability");
+# endif
# endif
/* Return the number of seconds that have elapsed since the Epoch. */
@@ -170,6 +182,12 @@ _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (time);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef time
+# if HAVE_RAW_DECL_TIME
+_GL_WARN_ON_USE (time, "time has consistency problems - "
+ "use gnulib module time for portability");
+# endif
# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
@@ -195,6 +213,12 @@ _GL_CXXALIAS_SYS (nanosleep, int,
(struct timespec const *__rqtp, struct timespec *__rmtp));
# endif
_GL_CXXALIASWARN (nanosleep);
+# elif defined GNULIB_POSIXCHECK
+# undef nanosleep
+# if HAVE_RAW_DECL_NANOSLEEP
+_GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - "
+ "use gnulib module nanosleep for portability");
+# endif
# endif
/* Initialize time conversion information. */
@@ -230,6 +254,12 @@ _GL_CXXALIAS_MDA (tzset, void, (void));
_GL_CXXALIAS_SYS (tzset, void, (void));
# endif
_GL_CXXALIASWARN (tzset);
+# elif defined GNULIB_POSIXCHECK
+# undef tzset
+# if HAVE_RAW_DECL_TZSET
+_GL_WARN_ON_USE (tzset, "tzset has portability problems - "
+ "use gnulib module tzset for portability");
+# endif
# endif
/* Return the 'time_t' representation of TP and normalize TP. */
@@ -246,6 +276,12 @@ _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mktime);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef mktime
+# if HAVE_RAW_DECL_MKTIME
+_GL_WARN_ON_USE (mktime, "mktime has portability problems - "
+ "use gnulib module mktime for portability");
+# endif
# endif
/* 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,
# if @HAVE_DECL_LOCALTIME_R@
_GL_CXXALIASWARN (gmtime_r);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef localtime_r
+# if HAVE_RAW_DECL_LOCALTIME_R
+_GL_WARN_ON_USE (localtime_r, "localtime_r is unportable - "
+ "use gnulib module time_r for portability");
+# endif
+# undef gmtime_r
+# if HAVE_RAW_DECL_GMTIME_R
+_GL_WARN_ON_USE (gmtime_r, "gmtime_r is unportable - "
+ "use gnulib module time_r for portability");
+# endif
# endif
/* 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));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (localtime);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef localtime
+# if HAVE_RAW_DECL_LOCALTIME
+_GL_WARN_ON_USE (localtime, "localtime has portability problems - "
+ "use gnulib module localtime for portability");
+# endif
# endif
# if 0 || @REPLACE_GMTIME@
@@ -347,6 +400,12 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
char const *restrict __format,
struct tm *restrict __tm));
_GL_CXXALIASWARN (strptime);
+# elif defined GNULIB_POSIXCHECK
+# undef strptime
+# if HAVE_RAW_DECL_STRPTIME
+_GL_WARN_ON_USE (strptime, "strptime is unportable - "
+ "use gnulib module strptime for portability");
+# endif
# endif
/* Convert *TP to a date and time string. See
@@ -368,6 +427,12 @@ _GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (ctime);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef ctime
+# if HAVE_RAW_DECL_CTIME
+_GL_WARN_ON_USE (ctime, "ctime has portability problems - "
+ "use gnulib module ctime for portability");
+# endif
# endif
/* Convert *TP to a date and time string. See
@@ -392,6 +457,12 @@ _GL_CXXALIAS_SYS (strftime, size_t,
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (strftime);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef strftime
+# if HAVE_RAW_DECL_STRFTIME
+_GL_WARN_ON_USE (strftime, "strftime has portability problems - "
+ "use gnulib module strftime-fixes for portability");
+# endif
# endif
# if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
@@ -469,6 +540,12 @@ _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
# if __GLIBC__ >= 2
_GL_CXXALIASWARN (timegm);
# endif
+# elif defined GNULIB_POSIXCHECK
+# undef timegm
+# if HAVE_RAW_DECL_TIMEGM
+_GL_WARN_ON_USE (timegm, "timegm is unportable - "
+ "use gnulib module timegm for portability");
+# endif
# endif
/* Encourage applications to avoid unsafe functions that can overrun
@@ -476,8 +553,10 @@ _GL_CXXALIASWARN (timegm);
applications should use strftime (or even sprintf) instead. */
# if defined GNULIB_POSIXCHECK
# undef asctime
+# if HAVE_RAW_DECL_ASCTIME
_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
# if defined GNULIB_POSIXCHECK
# undef asctime_r
@@ -488,8 +567,10 @@ _GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime
+# if HAVE_RAW_DECL_CTIME
_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
"better use strftime (or even sprintf) instead");
+# endif
# endif
# if defined GNULIB_POSIXCHECK
# undef ctime_r