https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78267

--- Comment #27 from Jack Howarth <howarth.at.gcc at gmail dot com> ---
IMHO, the fixincludes approach looks much more fragile than simply using the
approach suggested in Comment 5 of...

Index: libsanitizer/sanitizer_common/sanitizer_mac.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_mac.cc      (revision 242386)
+++ libsanitizer/sanitizer_common/sanitizer_mac.cc      (working copy)
@@ -34,7 +34,7 @@
 extern char **environ;
 #endif

-#if defined(__has_include) && __has_include(<os/trace.h>)
+#if defined(__has_include) && __has_include(<os/trace.h>) &&
defined(__clang__)
 #define SANITIZER_OS_TRACE 1
 #include <os/trace.h>
 #else

Even if you fix the regex selection in the proposed fixincludes for darwin15
and all prior OS X releases, the fix will still be fragile to future breakage
should the os/trace.h context change again.

The approach suggested in Comment 15 is robust and immune to that issue.

Reply via email to