Compiling a current grep snapshot with GCC 4.5.4, I see this warning: CC test-memrchr.o ../../gnulib-tests/test-memrchr.c:32:10: warning: unknown option after '#pragma GCC diagnostic' kind
The reason is that '#pragma GCC diagnostic' is only supported for GCC ≥ 4.7, see <https://lists.gnu.org/archive/html/bug-gnulib/2023-03/msg00033.html>. This patch should fix it. 2023-03-20 Bruno Haible <br...@clisp.org> memrchr tests: Avoid GCC warning. * tests/test-memrchr.c: Don't use '#pragma GCC diagnostic' for GCC versions older than 4.7. diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c index 0fd22187ab..7c52e7ca2e 100644 --- a/tests/test-memrchr.c +++ b/tests/test-memrchr.c @@ -28,7 +28,7 @@ SIGNATURE_CHECK (memrchr, void *, (void const *, int, size_t)); #include "macros.h" /* Work around GCC bug 101494. */ -#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && __GNUC__ < 12 +#if 4 < __GNUC__ + (7 <= __GNUC_MINOR__) && __GNUC__ < 12 # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif