This is an archive of the discontinued LLVM Phabricator instance.

sanitizer_common: fix SIG_DFL warning
ClosedPublic

Authored by dvyukov on May 10 2021, 4:46 AM.

Details

Summary

Currently we have:

sanitizer_posix_libcdep.cpp:146:27: warning: cast between incompatible

function types from ‘__sighandler_t’ {aka ‘void (*)(int)’} to ‘sa_sigaction_t’
146 |     sigact.sa_sigaction = (sa_sigaction_t)SIG_DFL;

We don't set SA_SIGINFO, so we need to assign to sa_handler.
And SIG_DFL is meant for sa_handler, so this gets rid of both
compiler warning, type cast and potential runtime misbehavior.

Diff Detail

Event Timeline

dvyukov requested review of this revision.May 10 2021, 4:46 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2021, 4:46 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.May 11 2021, 8:49 PM
This revision is now accepted and ready to land.May 11 2021, 8:49 PM
This revision was landed with ongoing or failed builds.May 11 2021, 10:23 PM
This revision was automatically updated to reflect the committed changes.