public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: FX Coudert <fxcoudert@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Iain Sandoe <iains.gcc@gmail.com>
Subject: [PATCH, committed] Testsuite, darwin: Fix analyzer testcases
Date: Sun, 20 Aug 2023 20:05:56 +0200	[thread overview]
Message-ID: <AAAE7A81-DA7B-4028-91DF-21573234419A@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

Committed as obvious, fixing three more darwin-specific failures in analyzer testsuite.
This fixes:

    FAIL: gcc.dg/plugin/taint-CVE-2011-0521-5.c -fplugin=./analyzer_kernel_plugin.so  (test for warnings, line 39)
    FAIL: gcc.dg/plugin/taint-CVE-2011-0521-6.c -fplugin=./analyzer_kernel_plugin.so  (test for warnings, line 36)
    XPASS: gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c -fplugin=./analyzer_kernel_plugin.so  (test for bogus messages, line 39)

Committed to trunk,
FX

[-- Attachment #2: 0001-Testsuite-darwin-Fix-analyzer-testcases.patch --]
[-- Type: application/octet-stream, Size: 2963 bytes --]

From 7694d0352a92d9f91c7afa69df0a0e56f95a771b Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Sun, 20 Aug 2023 20:02:43 +0200
Subject: [PATCH] Testsuite, darwin: Fix analyzer testcases

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 | 3 +++
 gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c       | 3 +++
 gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c       | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
index 8cb067c6542..2e74770a7a3 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5-fixed.c
@@ -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"
 
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
index 4ce047902d3..021d458b66e 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-5.c
@@ -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"
 
diff --git a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
index c54af790a56..f27e9eb5f02 100644
--- a/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
+++ b/gcc/testsuite/gcc.dg/plugin/taint-CVE-2011-0521-6.c
@@ -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"
 
-- 
2.39.2 (Apple Git-143)


                 reply	other threads:[~2023-08-20 18:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AAAE7A81-DA7B-4028-91DF-21573234419A@gmail.com \
    --to=fxcoudert@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iains.gcc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).