[clang] [Driver][BoundsSafety] Add -fbounds-safety-experimental flag (PR #70480)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 3 10:41:09 PDT 2023


================
@@ -0,0 +1,12 @@
+// This reports a warning to follow the default behavior of ClangAs.
+// RUN: %clang -fexperimental-bounds-safety -x assembler -c %s -o /dev/null 2>&1 | FileCheck -check-prefix WARN %s
+
+
+// WARN: warning: argument unused during compilation: '-fexperimental-bounds-safety'
+
+// expected-no-diagnostics
+// RUN: %clang -fexperimental-bounds-safety -Xclang -verify -c -x c %s -o /dev/null
+// Unlike '-x assembler', '-x assembler-with-cpp' silently ignores unused options by default.
+// XXX: Should report a targeted warning in future when assembler tries to use preprocessor directives to conditionalize behavior when bounds safety is enabled.
----------------
delcypher wrote:

@rapidsna We should file an issue and refer to it in the code.

I've created #71206 for you and created a new `clang:bounds-safety` tag so we can track all the `-fbounds-safety` issues in open source.

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


More information about the cfe-commits mailing list