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.
|
disable-object-size-check-O0.diff
Description: Binary data
vedant
+++ 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 theydon't get it. We should either diagnose this and behave as is, or justenable the sanitizer even though it's not effective for forwardscompatibility.
|
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits