Enable less FP exceptions for clang compiler when running tesseract

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2021-03-03 22:56:07 +01:00
parent c39b1daa6b
commit fe614c6069

View File

@ -622,7 +622,12 @@ static void PreloadRenderers(
int main(int argc, char** argv) { int main(int argc, char** argv) {
#if defined(__USE_GNU) #if defined(__USE_GNU)
// Raise SIGFPE. // 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); feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID);
#endif
#endif #endif
const char* lang = nullptr; const char* lang = nullptr;
const char* image = nullptr; const char* image = nullptr;