From: Paul Eggert Date: Thu, 9 May 2019 16:06:26 +0000 (-0700) Subject: verify: remove verify_true X-Git-Tag: v1.0~4960 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=8570cb9b74426d849ed78f57b6e78a0d043b9330;p=gnulib.git verify: remove verify_true * NEWS: Mention this. * lib/verify.h (verify_true): Remove. * tests/test-verify.c (item): Test verify_expr, not verify_true. --- diff --git a/ChangeLog b/ChangeLog index 760cde3c62..10c513cb63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2019-05-09 Paul Eggert + verify: remove verify_true + * NEWS: Mention this. + * lib/verify.h (verify_true): Remove. + * tests/test-verify.c (item): Test verify_expr, not verify_true. + Support C2X and C++17 static_assert C2X and C++17 finally added support for a simple, single-argument ‘static_assert’ that implements what the Gnulib ‘verify’ macro was diff --git a/NEWS b/NEWS index 77b9f24a79..2655d7fc93 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,8 @@ User visible incompatible changes Date Modules Changes +2019-05-90 verify verify_true (deprecated 2011-06-15) is removed. + 2019-02-02 c-strtod This and related modules no longer define the HAVE_C99_STRTOLD macro. Programs requiring standard strtold should use the strtold module. diff --git a/lib/verify.h b/lib/verify.h index d7e15bc8a3..f8e4eff026 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -149,9 +149,9 @@ which do not support _Static_assert, also do not warn about the last declaration mentioned above. - * GCC warns if -Wnested-externs is enabled and verify() is used + * GCC warns if -Wnested-externs is enabled and 'verify' is used within a function body; but inside a function, you can always - arrange to use verify_expr() instead. + arrange to use verify_expr instead. * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ @@ -235,17 +235,10 @@ template assert (R), there is no run-time overhead. There are two macros, since no single macro can be used in all - contexts in C. verify_true (R) is for scalar contexts, including + contexts in C. verify_expr (R, E) is for scalar contexts, including integer constant expression contexts. verify (R) is for declaration contexts, e.g., the top level. */ -/* Verify requirement R at compile-time, as an integer constant expression. - Return 1. This is equivalent to verify_expr (R, 1). - - verify_true is obsolescent; please use verify_expr instead. */ - -#define verify_true(R) _GL_VERIFY_TRUE (R) - /* Verify requirement R at compile-time. Return the value of the expression E. */ diff --git a/tests/test-verify.c b/tests/test-verify.c index e677d8aff3..0afbcabdea 100644 --- a/tests/test-verify.c +++ b/tests/test-verify.c @@ -39,7 +39,7 @@ verify (1 == 1); verify (1 == 1); /* should be ok */ enum { - item = verify_true (1 == 1) * 0 + 17 /* should be ok */ + item = verify_expr (1 == 1, 10) * 0 + 17 /* should be ok */ }; static int