Skip to content

Commit af11f9a

Browse files
committed
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 <[email protected]>
1 parent 400e6dd commit af11f9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docopt_value.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ namespace docopt {
7777
std::string strValue;
7878
std::vector<std::string> strList;
7979
};
80-
80+
81+
#pragma GCC diagnostic push
82+
#pragma GCC diagnostic ignored "-Wswitch-default"
8183
static const char* kindAsString(Kind kind) {
8284
switch (kind) {
8385
case Kind::Empty: return "empty";
@@ -88,6 +90,7 @@ namespace docopt {
8890
}
8991
return "unknown";
9092
}
93+
#pragma GCC diagnostic pop
9194

9295
void throwIfNotKind(Kind expected) const {
9396
if (kind_ == expected)

0 commit comments

Comments
 (0)