[PATCH] D100037: [clang][UBSan] Passing underaligned pointer as a function argument is undefined behaviour

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 11:33:42 PDT 2021


nickdesaulniers added a comment.

> Let's first give users tools to weed out the cases where the pointer
> passed into function's argument is underaligned.

Isn't there already `-Walign-mismatch` in clang?  We definitely have 1 unresolved case of that affecting the Linux kernel ATM: https://github.com/ClangBuiltLinux/linux/issues/1328



================
Comment at: clang/docs/ReleaseNotes.rst:52
+  however, there's interest in doing so now.
+  A new ``-fstrict-pointer-alignment`` flag was introduces (default on), which
+  will guard these new optimizations in the future, and allow disabling them.
----------------
s/was//


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100037/new/

https://reviews.llvm.org/D100037



More information about the cfe-commits mailing list