From 0b4162e71403863cff688128f28082df297f58d8 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 5 Sep 2019 13:53:13 +0100 Subject: [PATCH] build: Disable dtrace probes under static analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macros for the probes confuse the static analyser, and are often called with arguments which the analyser things shouldn’t be used any more (for example, the address of a block of memory which has just been freed). Signed-off-by: Philip Withnall Helps: #1767 --- gio/gio_trace.h | 4 +++- glib/glib_trace.h | 4 +++- gobject/gobject_trace.h | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gio/gio_trace.h b/gio/gio_trace.h index 47d4eacb2..addb70ae4 100644 --- a/gio/gio_trace.h +++ b/gio/gio_trace.h @@ -25,7 +25,9 @@ #error "config.h must be included prior to gio_trace.h" #endif -#ifdef HAVE_DTRACE +/* Ignore probes when doing static analysis, as they do weird things which + * confuses the analyser. */ +#if defined(HAVE_DTRACE) && !defined(__clang_analyzer__) /* include the generated probes header and put markers in code */ #include "gio_probes.h" diff --git a/glib/glib_trace.h b/glib/glib_trace.h index 1876738cf..fdb8f8c46 100644 --- a/glib/glib_trace.h +++ b/glib/glib_trace.h @@ -25,7 +25,9 @@ #error "config.h must be included prior to glib_trace.h" #endif -#ifdef HAVE_DTRACE +/* Ignore probes when doing static analysis, as they do weird things which + * confuses the analyser. */ +#if defined(HAVE_DTRACE) && !defined(__clang_analyzer__) /* include the generated probes header and put markers in code */ #include "glib_probes.h" diff --git a/gobject/gobject_trace.h b/gobject/gobject_trace.h index 30ef2fb5b..261fdac07 100644 --- a/gobject/gobject_trace.h +++ b/gobject/gobject_trace.h @@ -25,7 +25,9 @@ #error "config.h must be included prior to gobject_trace.h" #endif -#ifdef HAVE_DTRACE +/* Ignore probes when doing static analysis, as they do weird things which + * confuses the analyser. */ +#if defined(HAVE_DTRACE) && !defined(__clang_analyzer__) /* include the generated probes header and put markers in code */ #include "gobject_probes.h"