Skip to content

Commit e1d72e1

Browse files
committed
Temporarily change O2_DISABLE_FPE_TRAP to O2_ENABLE_FPE_TRAP
Given that there are potentially many places producing FPE if with FPE trapping enbaled, in order to merge this PR changing default to NOT enable trapping with possibility to enable it via env.var O2_ENABLE_FPE_TRAP with bits corresponding to enabled FEs: FE_INVALID(=8)|FE_DIVBYZERO(=4)|FE_OVERFLOW(=1)
1 parent a3517a5 commit e1d72e1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Common/Utils/src/fpu.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ static void __attribute__((constructor)) trapfpe()
3333
{
3434
// allows to disable set of particular FE's by setting corresponding bit of the O2_DISABLE_FPE_TRAP,
3535
// i.e. to enable only FE_DIVBYZERO use O2_DISABLE_FPE_TRAP=9
36-
const char* ev = std::getenv("O2_DISABLE_FPE_TRAP");
37-
int enabledFE = (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW) & ~(ev ? atoi(ev) : 0);
36+
// const char* ev = std::getenv("O2_DISABLE_FPE_TRAP");
37+
// int enabledFE = (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW) & ~(ev ? atoi(ev) : 0);
38+
const char* ev = std::getenv("O2_ENABLE_FPE_TRAP");
39+
int enabledFE = (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW) & (ev ? atoi(ev) : 0);
3840
if (enabledFE) {
3941
feenableexcept(enabledFE);
4042
}

0 commit comments

Comments
 (0)