Although "gcc -fcheck-pointer-bounds -mmpx -static" does not produce
real findings (only a dozen of false positives), it is good to avoid
havoc. Namely, two of the gnulib tests produce an endless series of
"Saw a #BR!" messages in the log file, thus filling up the disk, whatever
size it may have. Here is the workaround.


2019-03-10  Bruno Haible  <br...@clisp.org>

        tests: Avoid havoc with "gcc -fcheck-pointer-bounds".
        * tests/test-fprintf-posix2.c: Skip the test when -fcheck-pointer-bounds
        is in use.
        * tests/test-printf-posix2.c: Likewise.

diff --git a/tests/test-fprintf-posix2.c b/tests/test-fprintf-posix2.c
index 81aea17..c55e509 100644
--- a/tests/test-fprintf-posix2.c
+++ b/tests/test-fprintf-posix2.c
@@ -20,7 +20,10 @@
 
 #include <stdio.h>
 
-#if HAVE_GETRLIMIT && HAVE_SETRLIMIT
+/* This test assumes getrlimit() and setrlimit().
+   With "gcc -fcheck-pointer-bounds -mmpx -static", it produces an
+   endless loop of "Saw a #BR!" messages.  */
+#if HAVE_GETRLIMIT && HAVE_SETRLIMIT && !defined __CHKP__
 
 #include <stdlib.h>
 #include <sys/types.h>
diff --git a/tests/test-printf-posix2.c b/tests/test-printf-posix2.c
index 839e83a..8a26bf2 100644
--- a/tests/test-printf-posix2.c
+++ b/tests/test-printf-posix2.c
@@ -20,7 +20,10 @@
 
 #include <stdio.h>
 
-#if HAVE_GETRLIMIT && HAVE_SETRLIMIT
+/* This test assumes getrlimit() and setrlimit().
+   With "gcc -fcheck-pointer-bounds -mmpx -static", it produces an
+   endless loop of "Saw a #BR!" messages.  */
+#if HAVE_GETRLIMIT && HAVE_SETRLIMIT && !defined __CHKP__
 
 #include <stdlib.h>
 #include <sys/types.h>


Reply via email to