diff options
author | Zack Weinberg <zackw@panix.com> | 2020-08-28 13:59:05 -0400 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-08-28 13:59:05 -0400 |
commit | a2a6641c52994641bd10fb5efe2ecc51c07d798e (patch) | |
tree | 8de31dbcbd5a44ce2bde6b211e67c0f3d57cdd0a | |
parent | 845302b9b67f8ac10b050145c31e4463e60decb8 (diff) | |
download | autoconf-a2a6641c52994641bd10fb5efe2ecc51c07d798e.tar.gz |
Suppress ‘make syntax-check’ complaint about use of strcmp.
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.
-rw-r--r-- | lib/autoconf/c.m4 | 4 |
1 files changed, 3 insertions, 1 deletions
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")); } } |