[compiler-rt] Fixing UB on Windows for trampoline allocations (PR #85639)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 07:04:54 PDT 2024


mstorsjo wrote:

> > > This is _actually_ used on Windows, so removing `UNUSED`
> > 
> > 
> > No, it's not used in i386 mode. It's used in some modes, but not all - therefore it is marked as unused to silence warnings in those build configuration. See [979c38c](https://github.com/llvm/llvm-project/commit/979c38cc74f4e96c5e1bee1f966a81038fff1ed6) which introduced the attribute here.
> 
> Then shouldn't it be guarded by `#if SANITIZER_WINDOWS64` rather than `UNUSED`? When I was debugging I was confused by the presence of `UNUSED`.

That's certainly an option too. IIRC I proposed that originally, but avoiding ifdefs and marking it unused was suggested here: https://reviews.llvm.org/D91852#inline-861716

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


More information about the llvm-commits mailing list