diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2020-09-17 17:40:02 +0200 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2020-09-17 20:01:29 +0200 |
commit | 66d06b033c3f6eafde901418be3c089ffcc6ebfc (patch) | |
tree | 0d1f4edaf6362bd5913a18b9a9b690b97134c7c8 /cores/arduino | |
parent | b8c6c850421d0d81bb5ea9c340c4fcd958937165 (diff) |
Call std::terminate on pure or deleted virtual functions
These are special functions that are presumably put into vtables for
deleted or pure virtual functions. Previously, this would call `abort()`
directly, but calling `std::terminate()` achieves the same effect, but
allows user code to change the behavior (e.g. to print to serial, blink
leds or whatever makes sense).
Diffstat (limited to 'cores/arduino')
-rw-r--r-- | cores/arduino/abi.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/cores/arduino/abi.cpp b/cores/arduino/abi.cpp index b8f76cf..6e1b0f8 100644 --- a/cores/arduino/abi.cpp +++ b/cores/arduino/abi.cpp @@ -28,14 +28,9 @@ namespace std { } void __cxa_pure_virtual(void) { - // We might want to write some diagnostics to uart in this case - //std::terminate(); - abort(); + std::terminate(); } void __cxa_deleted_virtual(void) { - // We might want to write some diagnostics to uart in this case - //std::terminate(); - abort(); + std::terminate(); } - |