From a2a6641c52994641bd10fb5efe2ecc51c07d798e Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 28 Aug 2020 13:59:05 -0400 Subject: =?UTF-8?q?Suppress=20=E2=80=98make=20syntax-check=E2=80=99=20comp?= =?UTF-8?q?laint=20about=20use=20of=20strcmp.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recently ‘make syntax-check’ added a lint rule discouraging use of bare ‘strcmp’ (in favor of gnulib’s streq/strneq wrappers), which triggers on some code in c.m4’s test for C++98 compliance. This lint rule makes sense for typical C programs coded to GNU’s standards, but not for autoconf’s test programs. There is no way to disable it from outside the code, so this patch adds parentheses around the name ‘strcmp’, which is sufficient to disable this grep-based lint but doesn’t change the meaning of the code as understood by an actual C++ compiler. * c.m4 (_AC_CXX_CXX98_TEST_HEADER): Suppress ‘make syntax-check’ error on use of strcmp. --- lib/autoconf/c.m4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index eaef13a9..5d6e7b71 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -2261,7 +2261,9 @@ void test_exception_syntax() try { throw "test"; } catch (const char *s) { - assert (!strcmp (s, "test")); + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); } } -- cgit v1.2.1