diff --git a/CPP/Clipper2Lib/include/clipper2/clipper.core.h b/CPP/Clipper2Lib/include/clipper2/clipper.core.h index 40124804..624de903 100644 --- a/CPP/Clipper2Lib/include/clipper2/clipper.core.h +++ b/CPP/Clipper2Lib/include/clipper2/clipper.core.h @@ -88,6 +88,9 @@ namespace Clipper2Lib throw Clipper2Exception(undefined_error); case range_error_i: throw Clipper2Exception(range_error); + // Should never happen, but adding this to stop a compiler warning + default: + throw Clipper2Exception("Unknown error"); } #else ++error_code; // only to stop compiler warning diff --git a/CPP/Clipper2Lib/src/clipper.engine.cpp b/CPP/Clipper2Lib/src/clipper.engine.cpp index d3a146b4..97717322 100644 --- a/CPP/Clipper2Lib/src/clipper.engine.cpp +++ b/CPP/Clipper2Lib/src/clipper.engine.cpp @@ -928,6 +928,9 @@ namespace Clipper2Lib { case FillRule::Negative: if (e.wind_cnt != -1) return false; break; + // Should never happen, but adding this to stop a compiler warning + default: + break; } switch (cliptype_) @@ -978,6 +981,9 @@ namespace Clipper2Lib { break; case ClipType::Xor: return true; break; + // Should never happen, but adding this to stop a compiler warning + default: + break; } return false; // we should never get here }