Skip to content

Add a cvar to enable floating point exceptions #770

@slipher

Description

@slipher

Floating point exceptions can be useful to detect bugs such as floating point division by zero. A cvar to turn that on would be a useful debugging tool. Preferably on a per-module basis (engine/cgame/sgame). To turn it on for only a gamelogic module you'll need to use a native exe since a DLL shares the global state with the engine and I doubt this functionality is available in NaCl.

On Windows the exceptions can be enabled like

unsigned dummy;
if (0 != _controlfp_s(&dummy, 0, _EM_INVALID | _EM_ZERODIVIDE /* | _EM_OVERFLOW */))
    Log::Warn("error");

On Linux feenableexcept can be used

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions