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

Nick Desaulniers via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 09:03:26 PDT 2023


================
@@ -330,6 +330,14 @@ def warn_alias_with_section : Warning<
   "as the %select{aliasee|resolver}2">,
   InGroup<IgnoredAttributes>;
 
+let CategoryName = "Bounds Safety Issue" in {
+def err_bounds_safety_lang_not_supported : Error<
+  "bounds safety is only supported for C">;
+def warn_bounds_safety_asm_ignored : Warning<
+  "'-fbounds-safety' is ignored for assembly">,
----------------
nickdesaulniers wrote:

Do we even need a diagnostic specific to assembler? I get the point that some projects Makefiles pass compiler flags to the assembler invocation (which in the case of LLVM based builds, the assembler is clang).  But to me "bounds safety is only supported for C" is a superset of of "is ignored for assembly."  Seems like we could get away with only one diagnostic (the first "is not C" one).

Or was this particularly helpful for teams that got confused as to why the compiler (invoked as the assembler) was yelling at them?

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


More information about the cfe-commits mailing list