Skip to content

Commit

Permalink
[runtime] Fix -Wcast-function-type-mismatch warnings; NFC (3/4)
Browse files Browse the repository at this point in the history
__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.
  • Loading branch information
bryanpkc committed Oct 2, 2024
1 parent 153005a commit d73473e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions runtime/flangrti/trace_lin.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ __abort_sig_hand(int sig, siginfo_t *in, FLANGRTI_UCONTEXT_T *u)
struct sigaction new;
struct sigaction old;

new.sa_sigaction = (void (*)(int, siginfo_t *, void *))SIG_DFL;
new.sa_handler = SIG_DFL;
sigemptyset(&new.sa_mask);
new.sa_flags = SA_SIGINFO;
n = 0;
while (sigs[n].sig != 0) {
sigaction(sigs[n].sig, &new, &old);
Expand Down

0 comments on commit d73473e

Please sign in to comment.