[all-commits] [llvm/llvm-project] 89e56e: [Clang] Don't warn if deferencing void pointers in...

Jun Zhang via All-commits all-commits at lists.llvm.org
Tue Sep 27 21:30:37 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89e56e732d5e89d8715a501158793ac305bc4b70
      https://github.com/llvm/llvm-project/commit/89e56e732d5e89d8715a501158793ac305bc4b70
  Author: Jun Zhang <jun at junz.org>
  Date:   2022-09-28 (Wed, 28 Sep 2022)

  Changed paths:
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/Analysis/misc-ps.m
    A clang/test/Sema/no-warn-void-ptr-uneval.c

  Log Message:
  -----------
  [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 at junz.org>

Differential Revision: https://reviews.llvm.org/D134702




More information about the All-commits mailing list