How to detect when -fsanitize=memory is in effect?

39 views
Skip to first unread message

nolo...@gmail.com

unread,
Feb 27, 2016, 11:45:28 AM2/27/16
to memory-sanitizer
We support a number of compilers going back to the late 1990s. I'm trying to guard similar to the following code:

  #include <sanitizer/msan_interface.h>
  ...

  __msan_unpoison(&readfds, sizeof(readfds));
  __msan_unpoison(&writefds, sizeof(writefds));

I don't see a preprocessor macro I can use to guard it:

  $ clang -dM -E -fsanitize=memory - </dev/null | egrep -i 'memory|sanitize|msan'
  $

How can I guard the additional instrumentation?

Thanks in advance,

Konstantin Serebryany

unread,
Feb 27, 2016, 12:59:42 PM2/27/16
to memory-s...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "memory-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to memory-sanitiz...@googlegroups.com.
To post to this group, send email to memory-s...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/memory-sanitizer/f24d07a1-d8fe-4b09-b07c-e5f1d16e4d47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages