Good point, it makes sense to hand users a warning when they explicitly enable -fsanitize=object-size at -O0. I've added in the diagnostic. PTAL.

Attachment: disable-object-size-check-O0.diff
Description: Binary data


vedant

On Jun 23, 2017, at 1:05 PM, Justin Bogner <m...@justinbogner.com> wrote:

+++ test/Driver/fsanitize-object-size.c
@@ -0,0 +1,25 @@
+// Check that the object size check is disabled at -O0.
+//
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE
+// RUN: %clang -target x86_64-linux-gnu -fsanitize=object-size %s -O0 -### 2>&1 | FileCheck %s --check-prefix=CHECK-NO-OSIZE

This isn't great - the user explicitly opted in to object-size but they
don't get it. We should either diagnose this and behave as is, or just
enable the sanitizer even though it's not effective for forwards
compatibility.

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to