Commit Graph

2 Commits

Author SHA1 Message Date
Nick Desaulniers 2dbfd06f2a [Clang] fix -Wvoid-ptr-dereference for gnu89
Follow up to D134702; it looks like we were still warning for gnu89
mode.

Link: https://reviews.llvm.org/D134702
Link: https://github.com/ClangBuiltLinux/linux/issues/1720#issuecomment-1265738778

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D135090
2022-10-04 13:01:01 -07:00
Jun Zhang 89e56e732d
[Clang] Don't warn if deferencing void pointers in unevaluated context
After https://reviews.llvm.org/D134461, Clang will diagnose a warning if
trying to deference void pointers in C mode. However, this causes a lot
of noises when compiling a 5.19.11 Linux kernel.

This patch reduces the warning by marking deferencing void pointers in
unevaluated context OK, like `sizeof(*void_ptr)`, `typeof(*void_ptr)`
and etc.

Fixes https://github.com/ClangBuiltLinux/linux/issues/1720

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D134702
2022-09-28 12:30:02 +08:00