Hacker News new | ask | show | jobs
by taspeotis 4480 days ago

    -fno-exceptions
    I don’t like C++ exceptions. And we don’t use them where I work
And none of your code uses the STL nor third party libraries that might throw exceptions either, right [1]

[1] "Doing without" http://gcc.gnu.org/onlinedocs/libstdc++/manual/using_excepti...

2 comments

AFAIK, stl (and beyond that, C++) throw exceptions especially in case of allocation failure (ie. new or push_back() failing to allocate memory), and more generally in case of programming errors (out_of_range, bad_cast etc.), and I am 100% okay with the program aborting() in such situation.
Do you use things like the range-checked `std::vector::at` or `dynamic_cast` with reference types at all then? If so, do you put a breakpoint on `abort` during development?
Most code can use -fno-rtti Real Time Type Info
run-time type information