I have a complex model written in C++ where denominators sometimes happens to be zeros. I normally check for them, but when I forgot, it's a pain to debug them as the model continues without warnings.
Is there a compiler flag, working in both recent versions of gcc in linux and MinGW on windows, that I can use to tell gcc to compile as to raise a runtime error when (between doubles) division by zero happens ? Is this computationally expensive (so to enable it only in debug builds) ?
I am aware of a similar question that has been posted here, but the answers are more a mix of technical and theoretical quick comments rather than a developed answer.