bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tests: Avoid havoc with "gcc -fcheck-pointer-bounds"


From: Bruno Haible
Subject: tests: Avoid havoc with "gcc -fcheck-pointer-bounds"
Date: Sun, 10 Mar 2019 17:14:06 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

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  <address@hidden>

        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

[Prev in Thread] Current Thread [Next in Thread]