[clang] [clang] Emitting a warning if optimizations are enabled with sanitizers (PR #95934)

Sandeep Kosuri via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 01:48:30 PDT 2024


================
@@ -477,6 +477,8 @@ def warn_drv_disabling_vptr_no_rtti_default : Warning<
 def warn_drv_object_size_disabled_O0 : Warning<
   "the object size sanitizer has no effect at -O0, but is explicitly enabled: %0">,
   InGroup<InvalidCommandLineArgument>, DefaultWarnNoWerror;
+def warn_sanitizer_with_optimization : Warning<
+  "enabling optimizations with sanitizers may potentially reduce effectiveness">;
----------------
sandeepkosuri wrote:

```suggestion
  "enabling optimizations may reduce the effectiveness of sanitizers">;
```

https://github.com/llvm/llvm-project/pull/95934


More information about the cfe-commits mailing list