From af11f9a84e1a434caae89d1e8c7fb68b14c91e00 Mon Sep 17 00:00:00 2001 From: Eero Aaltonen Date: Tue, 9 Apr 2024 14:04:16 +0300 Subject: [PATCH] Silence switch-default error in docopt_value.h When a project using docopt.cpp is built with `-Werror=switch-default` option, there's an error ``` error: switch missing default case [-Werror=switch-default] ``` which this fixes. Signed-off-by: Eero Aaltonen --- docopt_value.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docopt_value.h b/docopt_value.h index e1c87e6..e544ab8 100644 --- a/docopt_value.h +++ b/docopt_value.h @@ -77,7 +77,9 @@ namespace docopt { std::string strValue; std::vector strList; }; - + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wswitch-default" static const char* kindAsString(Kind kind) { switch (kind) { case Kind::Empty: return "empty"; @@ -88,6 +90,7 @@ namespace docopt { } return "unknown"; } +#pragma GCC diagnostic pop void throwIfNotKind(Kind expected) const { if (kind_ == expected)