[all-commits] [llvm/llvm-project] 71defe: [sanitizer_common] Suppress warning of cast from S...
Thurston Dang via All-commits
all-commits at lists.llvm.org
Wed Mar 20 18:17:55 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 71defe40b7df18508d63fb1b1233324e8a28688f
https://github.com/llvm/llvm-project/commit/71defe40b7df18508d63fb1b1233324e8a28688f
Author: Thurston Dang <thurston at google.com>
Date: 2024-03-20 (Wed, 20 Mar 2024)
Changed paths:
M compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cpp
Log Message:
-----------
[sanitizer_common] Suppress warning of cast from SignalHandlerType to sa_sigaction_t (#86046)
Some buildbots (e.g.,
https://lab.llvm.org/buildbot/#/builders/18/builds/16061/steps/10/logs/stdio)
have recently started complaining about
```
cast from 'SignalHandlerType' (aka 'void (*)(int, void *, void *)') to 'sa_sigaction_t' (aka 'void (*)(int, siginfo_t *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
219 | sigact.sa_sigaction = (sa_sigaction_t)handler;
```
This patch does an intermediate cast to `'(void (*) (void))'` to suppress the warning.
N.B. SignalHandlerType has `'void*'` instead of `'siginfo_t*'` because it is typedef'ed in sanitizer_common/sanitizer_common.h, which does not have access to the header (signal.h) that defines siginfo_t; we therefore cannot fix SignalHandlerType.
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