[PATCH] D100879: [Clang] Propagate guaranteed alignment for malloc and others
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 21 19:58:51 PST 2021
rjmccall added a comment.
Platforms are permitted to make stronger guarantees than the C standard requires, and it is totally reasonable for compilers to assume that `malloc` meets the target platform's documented guarantees. Arguably, libraries should not be replacing `malloc` if they fail to meet the platform's documented guarantees.
With that said, it's probably not unreasonable for Clang to provide an option that controls its assumptions about `malloc`. We should think somewhat carefully about whether there are other behaviors we'd want to include in that, though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100879/new/
https://reviews.llvm.org/D100879
More information about the cfe-commits
mailing list