https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109489

            Bug ID: 109489
           Summary: [ubsan] Support -fsanitize-trap=
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i at maskray dot me
  Target Milestone: ---

Clang has supported -fsanitize-trap=undefined and many fine-grained options[1]
e.g. -fsanitize-trap=alignment since 2015.

-fsanitize-undefined-trap-on-error is a deprecated alias for
-fsanitize-trap=undefined in Clang. -fsanitize-trap= provides fine-grained
control over putting specific checks into the trap mode, and it provides a
unified interface with -fsanitize= and -fsanitize-recover=.

As an example, -fsanitize=undefined in the normal mode may increase the binary
size a lot.
The user may put some checks into the trap mode while keeping the rest in the
normal mode (-fsanitize-trap=alignment,null) to make the binary smaller.

[1]: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

Reply via email to