[all-commits] [llvm/llvm-project] 6bb4ce: Silence spurious -Wnontrivial-memcall warnings in ...

Akira Hatanaka via All-commits all-commits at lists.llvm.org
Tue Apr 29 18:38:18 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bb4ce0f6ff462b58bacc8dbc47719b7009f9b18
      https://github.com/llvm/llvm-project/commit/6bb4ce0f6ff462b58bacc8dbc47719b7009f9b18
  Author: Akira Hatanaka <ahatanak at gmail.com>
  Date:   2025-04-29 (Tue, 29 Apr 2025)

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

  Log Message:
  -----------
  Silence spurious -Wnontrivial-memcall warnings in C mode (#137429)

clang currently issues a warning when memset is used on a struct that
contains an address-discriminated pointer field, even though this is
entirely valid behavior.

For example:

```
struct S {
  int * __ptrauth(1, 1, 100) p;
} s;

memset(&s, 0, sizeof(struct S));
```

Only allow the warning to be emitted in C++ mode to silence the warning.

rdar://142495870



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