]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Testsuite, darwin: Fix analyzer testcases
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sun, 20 Aug 2023 18:02:43 +0000 (20:02 +0200)
committerFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sun, 20 Aug 2023 18:02:43 +0000 (20:02 +0200)
On darwin, system headers are fortified by default and that defeats the
analyzer's warnings on memcpy() calls.  Turn this off for testing.

gcc/testsuite/ChangeLog:

* gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c: Use
_FORTIFY_SOURCE=0 on darwin.
* gcc.dg/plugin/taint-CVE-2011-0521-5.c: Likewise.
* gcc.dg/plugin/taint-CVE-2011-0521-6.c: Likewise.

gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c

index 8cb067c6542bba0c1dd1daa81f2d7213af62038b..2e74770a7a33f5656daafc37ec528454e52b0147 100644 (file)
@@ -4,6 +4,9 @@
 /* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
 /* { dg-require-effective-target analyzer } */
 
+/* On darwin, system headers are fortified, which defeats the analysis.  Turn it off.  */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
 
index 4ce047902d3e4901513c6efcbdb926305e3290e6..021d458b66ef78e6925269606c6d52e0677766c9 100644 (file)
@@ -4,6 +4,9 @@
 /* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
 /* { dg-require-effective-target analyzer } */
 
+/* On darwin, system headers are fortified, which defeats the analysis.  Turn it off.  */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"
 
index c54af790a564ea312b6120dd8dd08e7c4cb047f5..f27e9eb5f02093b97f506f0fbbb0298ce7f8e696 100644 (file)
@@ -4,6 +4,9 @@
 /* { dg-options "-fanalyzer -fanalyzer-checker=taint --param=analyzer-max-svalue-depth=25" } */
 /* { dg-require-effective-target analyzer } */
 
+/* On darwin, system headers are fortified, which defeats the analysis.  Turn it off.  */
+/* { dg-additional-options "-D_FORTIFY_SOURCE=0" { target *-*-darwin* } } */
+
 /* See notes in this header.  */
 #include "taint-CVE-2011-0521.h"