public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-11393] Testsuite: fix analyzer tests on Darwin
@ 2024-04-28 14:43 Iain D Sandoe
  0 siblings, 0 replies; only message in thread
From: Iain D Sandoe @ 2024-04-28 14:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ee2f7a02371aba24f6db6231ae862cd2248bf45f

commit r11-11393-gee2f7a02371aba24f6db6231ae862cd2248bf45f
Author: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date:   Sat Aug 19 23:22:06 2023 +0200

    Testsuite: fix analyzer tests on Darwin
    
    On macOS, system headers redefine by default some macros (memcpy,
    memmove, etc) to checked versions, which defeats the analyzer. We
    want to turn this off.
    See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104042
    
    gcc/testsuite/ChangeLog:
    
            PR analyzer/104042
            * gcc.dg/analyzer/analyzer.exp: Pass -D_FORTIFY_SOURCE=0 on Darwin.
    
    (cherry picked from commit ce33bbfcbc7dd3afc6c96fb48a19ed00f0c598ce)

Diff:
---
 gcc/testsuite/gcc.dg/analyzer/analyzer.exp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/analyzer/analyzer.exp b/gcc/testsuite/gcc.dg/analyzer/analyzer.exp
index e4b198bee87..7a2f7e906e9 100644
--- a/gcc/testsuite/gcc.dg/analyzer/analyzer.exp
+++ b/gcc/testsuite/gcc.dg/analyzer/analyzer.exp
@@ -32,6 +32,14 @@ if [info exists DEFAULT_CFLAGS] then {
 # If a testcase doesn't have special options, use these.
 set DEFAULT_CFLAGS "-fanalyzer -Wanalyzer-too-complex -fanalyzer-call-summaries"
 
+if { [istarget "*-*-darwin*" ] } {
+  # On macOS, system headers redefine by default some macros (memcpy,
+  # memmove, etc) to checked versions, which defeats the analyzer. We
+  # want to turn this off.
+  # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104042
+  set DEFAULT_CFLAGS "$DEFAULT_CFLAGS -D_FORTIFY_SOURCE=0"
+}
+
 # Initialize `dg'.
 dg-init

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-28 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-28 14:43 [gcc r11-11393] Testsuite: fix analyzer tests on Darwin Iain D Sandoe

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).