Mercurial > octave
changeset 33381:6f7fe3f85253
rely on compiler warnings for unhandled enum switch cases in Quad classes
* Quad.cc: Don't use default cases in switch statements that use enum
values so that compilers may warn about unhandled enum values.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 12 Apr 2024 11:17:04 -0400 |
parents | c9517a0c9cc2 |
children | 79cfa1b7a813 |
files | liboctave/numeric/Quad.cc |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/numeric/Quad.cc Fri Apr 12 10:47:48 2024 -0400 +++ b/liboctave/numeric/Quad.cc Fri Apr 12 11:17:04 2024 -0400 @@ -169,9 +169,9 @@ inf = 2; break; - default: - liboctave_panic_impossible (); - break; + // We should have handled all possible enum values above. Rely on + // compiler diagnostics to warn if we haven't. For example, GCC's + // -Wswitch option, enabled by -Wall, will provide a warning. } double abs_tol = absolute_tolerance (); @@ -286,9 +286,9 @@ inf = 2; break; - default: - liboctave_panic_impossible (); - break; + // We should have handled all possible enum values above. Rely on + // compiler diagnostics to warn if we haven't. For example, GCC's + // -Wswitch option, enabled by -Wall, will provide a warning. } float abs_tol = single_precision_absolute_tolerance ();