[all-commits] [llvm/llvm-project] a92d09: [clang] warn_cstruct_memaccess and warn_cxxstruct_...

Oliver Hunt via All-commits all-commits at lists.llvm.org
Wed Dec 3 16:18:48 PST 2025


  Branch: refs/heads/users/ojhunt/relax-memaccess-warnings
  Home:   https://github.com/llvm/llvm-project
  Commit: a92d09040831c7b83326d6141ea68e8548229173
      https://github.com/llvm/llvm-project/commit/a92d09040831c7b83326d6141ea68e8548229173
  Author: Oliver Hunt <oliver at apple.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

  Changed paths:
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/warn-nontrivial-struct-memaccess-ptrauth.c
    M clang/test/SemaCXX/warn-memaccess.cpp
    M clang/test/SemaObjC/warn-nontrivial-struct-memaccess.m

  Log Message:
  -----------
  [clang] warn_cstruct_memaccess and warn_cxxstruct_memaccess are too agressive about initializers

These warnings are triggered for zeroing initializers of non-trivially
initializable and non-trivially copyable types.

This results in significant numbers of warnings in idiomatic object
initialization code, where memset and similar are used to ensure no
stale data is present in fields or padding bytes.

Addresses #156996



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list