aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-01 17:11:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-01 17:11:15 +0200
commitd0a95f96e07b369a8a148ff23e5730aa1aa39ec0 (patch)
treed7707bd129e3df8bde6be011640ecb9685a34a4c
parent49508a7ed32a11c1c17202852f26ba72fa3eb218 (diff)
Fix GCC 7 -fimplicit-fallthrough warnings
-rw-r--r--libstudxml/buildfile9
-rw-r--r--libstudxml/parser.cxx12
2 files changed, 15 insertions, 6 deletions
diff --git a/libstudxml/buildfile b/libstudxml/buildfile
index 40c33d3..6093e24 100644
--- a/libstudxml/buildfile
+++ b/libstudxml/buildfile
@@ -42,6 +42,15 @@ if $version.pre_release
else
lib{studxml}: bin.lib.version = @"-$version.major.$version.minor"
+if ($c.class == 'gcc')
+{
+ # Disable warnings that pop up with -Wextra (e.g, -fimplicit-fallthrough)
+ # in C implementation details.
+ #
+ details/expat/: c.coptions += -Wno-extra
+ details/genx/: c.coptions += -Wno-extra
+}
+
# We are a mixed C/C++ library, though C is implementatio-only, kind of: we
# need headers but not symbols.
#
diff --git a/libstudxml/parser.cxx b/libstudxml/parser.cxx
index 343d492..11e4aaa 100644
--- a/libstudxml/parser.cxx
+++ b/libstudxml/parser.cxx
@@ -452,8 +452,8 @@ namespace xml
pqname_ = &qname_;
break; // No more declarations.
}
- // Fall through.
}
+ // Fall through.
case start_element:
{
event_ = start_namespace_decl;
@@ -497,8 +497,8 @@ namespace xml
pvalue_ = &value_;
break; // No more attributes.
}
- // Fall through.
}
+ // Fall through.
case start_element:
case start_namespace_decl:
{
@@ -531,13 +531,13 @@ namespace xml
pqname_ = &qname_;
break; // No more declarations.
}
- // Fall through.
}
- // The end namespace declaration comes before the end element
- // which means it can follow pretty much any other event.
- //
+ // Fall through.
default:
{
+ // The end namespace declaration comes before the end element which
+ // means it can follow pretty much any other event.
+ //
event_ = end_namespace_decl;
pqname_ = &end_ns_[end_ns_i_];
return event_;