Visual C++ / Weird behavior after enabling floating-point exceptions (compiler bug ?)

前端 未结 2 1042
春和景丽
春和景丽 2021-02-15 17:46

I am struggling to get a reliable way to catch floating points exceptions under Visual Studio (2005 or 2008). By default, under visual studio, floating point exceptions are not

2条回答
  •  不要未来只要你来
    2021-02-15 17:56

    You have to clear the FPU exception flags in the status word when you catch a floating point exception. Call _clearfp().

    Consider using _set_se_translator() to write an exception filter that translate the hardware exception to a C++ exception. Be sure to be selective, only translate the FPU exceptions.

提交回复
热议问题