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

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 09:12:12 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">,
----------------
MaskRay wrote:

For assembly input, we generally ignore handling the option and leave a warning https://maskray.me/blog/2023-08-25-clang-wunused-command-line-argument#assembly-files

```
% fclang -fsanitize=address -fpatchable-function-entry=2 -c a.s
clang: warning: argument unused during compilation: '-fsanitize=address' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-fpatchable-function-entry=2' [-Wunused-command-line-argument]
```

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


More information about the cfe-commits mailing list