diff --git a/src/api/tesseractmain.cpp b/src/api/tesseractmain.cpp index 543d59938..edf6637e1 100644 --- a/src/api/tesseractmain.cpp +++ b/src/api/tesseractmain.cpp @@ -622,7 +622,12 @@ static void PreloadRenderers( int main(int argc, char** argv) { #if defined(__USE_GNU) // Raise SIGFPE. +#if defined(__clang__) + // clang creates code which causes some FP exceptions, so don't enable those. + feenableexcept(FE_DIVBYZERO); +#else feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID); +#endif #endif const char* lang = nullptr; const char* image = nullptr;