@@ -36,23 +36,23 @@ To help you choose the right sanitizer for your needs and compiler, here is a su
3636+----------------------------------------+-----+-------+------+-----------------------------------------+
3737| Sanitizer | GCC | Clang | MSVC | Notes |
3838+========================================+=====+=======+======+=========================================+
39- | **AddressSanitizer (ASan) ** | ✅ | ✅ | ✅ | MSVC: Supports x86 and x64 |
39+ | **AddressSanitizer (ASan) ** | YES | YES | YES | MSVC: Supports x86 and x64 |
4040+----------------------------------------+-----+-------+------+-----------------------------------------+
41- | **ThreadSanitizer (TSan) ** | ✅ | ✅ | ❌ | Detects data races |
41+ | **ThreadSanitizer (TSan) ** | YES | YES | NO | Detects data races |
4242+----------------------------------------+-----+-------+------+-----------------------------------------+
43- | **MemorySanitizer (MSan) ** | ❌ | ✅ | ❌ | Clang-only, requires `-O1 ` |
43+ | **MemorySanitizer (MSan) ** | NO | YES | NO | Clang-only, requires `-O1 ` |
4444+----------------------------------------+-----+-------+------+-----------------------------------------+
45- | **UndefinedBehaviorSanitizer (UBSan) ** | ✅ | ✅ | ❌ | Wide range of undefined behavior checks |
45+ | **UndefinedBehaviorSanitizer (UBSan) ** | YES | YES | NO | Wide range of undefined behavior checks |
4646+----------------------------------------+-----+-------+------+-----------------------------------------+
47- | **LeakSanitizer (LSan) ** | ✅ | ✅ | ❌ | Often integrated with ASan |
47+ | **LeakSanitizer (LSan) ** | YES | YES | NO | Often integrated with ASan |
4848+----------------------------------------+-----+-------+------+-----------------------------------------+
49- | **HardwareAddressSanitizer (HWASan) ** | ❌ | ✅ | ❌ | ARM64 only, lower overhead than ASan |
49+ | **HardwareAddressSanitizer (HWASan) ** | NO | YES | NO | ARM64 only, lower overhead than ASan |
5050+----------------------------------------+-----+-------+------+-----------------------------------------+
51- | **KernelAddressSanitizer (KASan) ** | ✅ | ✅ | ✅ | MSVC: Requires Windows 11 |
51+ | **KernelAddressSanitizer (KASan) ** | YES | YES | YES | MSVC: Requires Windows 11 |
5252+----------------------------------------+-----+-------+------+-----------------------------------------+
53- | **DataFlowSanitizer (DFSan) ** | ❌ | ✅ | ❌ | Dynamic data flow analysis |
53+ | **DataFlowSanitizer (DFSan) ** | NO | YES | NO | Dynamic data flow analysis |
5454+----------------------------------------+-----+-------+------+-----------------------------------------+
55- | **Control Flow Integrity (CFI) ** | ❌ | ✅ | ✅ | MSVC: `/guard:cf ` |
55+ | **Control Flow Integrity (CFI) ** | NO | YES | YES | MSVC: `/guard:cf ` |
5656+----------------------------------------+-----+-------+------+-----------------------------------------+
5757
5858Besides MSVC having more limited support for sanitizers, it encourages the community to vote for new features
@@ -75,13 +75,13 @@ Here are some common combinations and their compatibility mostly used with GCC a
7575+-------------------+-----+-------+------+-----------------------------------------+
7676| Combination | GCC | Clang | MSVC | Compatibility |
7777+===================+=====+=======+======+=========================================+
78- | **ASan + UBSan ** | ✅ | ✅ | ❌ | Most common combination |
78+ | **ASan + UBSan ** | YES | YES | NO | Most common combination |
7979+-------------------+-----+-------+------+-----------------------------------------+
80- | **TSan + UBSan ** | ✅ | ✅ | ❌ | Good for multithreaded code |
80+ | **TSan + UBSan ** | YES | YES | NO | Good for multithreaded code |
8181+-------------------+-----+-------+------+-----------------------------------------+
82- | **ASan + LSan ** | ✅ | ✅ | ❌ | LSan often enabled by default with ASan |
82+ | **ASan + LSan ** | YES | YES | NO | LSan often enabled by default with ASan |
8383+-------------------+-----+-------+------+-----------------------------------------+
84- | **MSan + UBSan ** | ❌ | ✅ | ❌ | Requires careful dependency management |
84+ | **MSan + UBSan ** | NO | YES | NO | Requires careful dependency management |
8585+-------------------+-----+-------+------+-----------------------------------------+
8686
8787**Notes on combinations **:
0 commit comments