diff --git a/configure.ac b/configure.ac index 223fc2d1..1059c64d 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_FUNC_ALLOCA PKG_PROG_PKG_CONFIG() AC_CHECK_HEADERS(stdio.h stdlib.h fcntl.h sys/time.h unistd.h dirent.h) -AC_CHECK_HEADERS(ctype.h errno.h byteswap.h string.h time.h) +AC_CHECK_HEADERS(ctype.h errno.h byteswap.h string.h time.h fenv.h) AC_CHECK_HEADERS(endian.h sys/endian.h arpa/inet.h sys/poll.h syslog.h) AC_CHECK_HEADERS(alloca.h pthread.h stdio.h math.h signal.h sys/prctl.h) AC_CHECK_HEADERS(sys/types.h sys/socket.h sys/stat.h linux/un.h netdb.h) diff --git a/src/ckpool.c b/src/ckpool.c index fc3dd3a4..e08cbc2f 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -877,6 +878,9 @@ int main(int argc, char **argv) int c, ret, i; ckpool_t ckp; + /* Make significant floating point errors fatal to avoid subtle bugs being missed */ + feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW ); + global_ckp = &ckp; memset(&ckp, 0, sizeof(ckp)); ckp.loglevel = LOG_NOTICE;