1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-14 23:46:14 +00:00

Use sig_atomic_t for FP_error when using FP exceptions. (#220)

`sig_atomic_t` is usually `int`, but is the typedef that one
should use for flags written to from a signal handler.
This commit is contained in:
Bruce Mitchener 2021-01-14 00:52:53 +07:00 committed by GitHub
parent d3efbc3441
commit 62a8d400ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -27,7 +27,8 @@
-------------------------------------------------- */
#ifdef FLTINT
volatile extern int FP_error;
#include <signal.h>
extern volatile sig_atomic_t FP_error;
/* Note that a compiler may very likely move code around the arithmetic
operation, causing this test (set by an interrupt handler) to be

View File

@ -644,7 +644,7 @@ void int_unblock() {
/************************************************************************/
/* The global used to signal floating-point errors */
volatile int FP_error = 0;
volatile sig_atomic_t FP_error = 0;
void int_fp_service(int sig, siginfo_t *info, void *context)
{