From: Bruno Haible Date: Sat, 27 Mar 2010 19:09:55 +0000 (+0100) Subject: Use GNULIB_POSIXCHECK instead of GNULIB_PORTCHECK. X-Git-Tag: v0.1~4419 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=0f04b66b185a42244b1df2a0e9350727a55586ac;p=gnulib.git Use GNULIB_POSIXCHECK instead of GNULIB_PORTCHECK. --- diff --git a/ChangeLog b/ChangeLog index 57ded7c3c..0bfcebe25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-03-27 Bruno Haible + Use GNULIB_POSIXCHECK instead of GNULIB_PORTCHECK. + * lib/time.in.h (asctime, asctime_r, ctime, ctime_r): Test + GNULIB_POSIXCHECK, not GNULIB_PORTCHECK. Provide compile-time warnings + rather than link errors. + +2010-03-27 Bruno Haible + Avoid side effects from tests-related modules on the compilation of lib. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_CONDITION): New macro. (gl_MODULE_INDICATOR_SET_VARIABLE): Use its expansion as a value. diff --git a/lib/time.in.h b/lib/time.in.h index 7fa228a8e..3a3e5ab1b 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -185,15 +185,25 @@ _GL_CXXALIASWARN (timegm); /* Encourage applications to avoid unsafe functions that can overrun buffers when given outlandish struct tm values. Portable applications should use strftime (or even sprintf) instead. */ -# if GNULIB_PORTCHECK +# if defined GNULIB_POSIXCHECK # undef asctime -# define asctime eschew_asctime +_GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK # undef asctime_r -# define asctime_r eschew_asctime_r +_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK # undef ctime -# define ctime eschew_ctime +_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); +# endif +# if defined GNULIB_POSIXCHECK # undef ctime_r -# define ctime_r eschew_ctime_r +_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " + "better use strftime (or even sprintf) instead"); # endif #endif