Skip to content

Commit b03efc2

Browse files
committed
[runtime] Fix -Wcast-function-type-mismatch warnings; NFC (3/4)
__abort_sig_hand() resets signal handlers before printing an error message and calling abort(). The code used to set the sa_sigaction field to SIG_DFL, requiring an explicit cast which now causes a warning. It is actually not necessary to use sa_sigaction in this case; setting sa_handler to SIG_DFL is the idiomatic way which also avoids the warning.
1 parent 4a00056 commit b03efc2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

runtime/flangrti/trace_lin.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ __abort_sig_hand(int sig, siginfo_t *in, FLANGRTI_UCONTEXT_T *u)
215215
struct sigaction new;
216216
struct sigaction old;
217217

218-
new.sa_sigaction = (void (*)(int, siginfo_t *, void *))SIG_DFL;
218+
new.sa_handler = SIG_DFL;
219219
sigemptyset(&new.sa_mask);
220-
new.sa_flags = SA_SIGINFO;
221220
n = 0;
222221
while (sigs[n].sig != 0) {
223222
sigaction(sigs[n].sig, &new, &old);

0 commit comments

Comments
 (0)