2 ms·
C and C++ need to be usable in systems without memory protection, so they don't guarantee any faults for operations like method calls. (There are some standard-
by pcwalton 12y ago
C and C++ need to be usable in systems without memory protection, so they don't guarantee any faults for operations like method calls. (There are some standard-guaranteed exceptions, for example std::bad_alloc, but those are only on relatively expensive operations.)
Compilers then take advantage of these undefined behaviors to optimize even on systems that do have memory protection.