# HG changeset patch # User John W. Eaton # Date 1711214578 14400 # Node ID 08ab46f6e2416f905ed52cc1b0f210a3c6dba621 # Parent d9ed1a322311aaad349f3dfa66aff93812bd21a6 replace uses of assert with panic_impossible in ov.h * ov.h: Include panic.h. (octave_value_extract): Replace assert with panic_impossible. diff -r d9ed1a322311 -r 08ab46f6e241 libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Sat Mar 23 13:17:02 2024 -0400 +++ b/libinterp/octave-value/ov.h Sat Mar 23 13:22:58 2024 -0400 @@ -36,6 +36,8 @@ #include #include +#include "panic.h" + #include "data-conv.h" #include "idx-vector.h" #include "mach-info.h" @@ -1697,11 +1699,10 @@ extern OCTINTERP_API void install_types (octave::type_info&); // Templated value extractors. -// FIXME: would be more consistent to use panic_impossible(), rather than -// assert(), but including "error.h" leads to compilation errors. + template inline Value octave_value_extract (const octave_value&) -{ assert (false); } +{ panic_impossible (); } #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ template <> \ @@ -1772,7 +1773,7 @@ template <> \ inline VALUE octave_value_extract (const octave_value&) \ { \ - assert (false); \ + panic_impossible (); \ return DEFVAL; \ }