From 351a8cb32184cd4a108e31cf0ee7626100a421dc Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Mon, 15 May 2017 18:24:39 +0100 Subject: [PATCH] Comment why doContent's default case is never executed. Also add comment markers so lcov can ignore the unreachable code. --- expat/lib/xmlparse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 111474e5..eef03c90 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -3074,9 +3074,17 @@ doContent(XML_Parser parser, return XML_ERROR_NO_MEMORY; break; default: + /* All of the tokens produced by XmlContentTok() have their own + * explicit cases, so this default is not strictly necessary. + * However it is a useful safety net, so we retain the code and + * simply exclude it from the coverage tests. + * + * LCOV_EXCL_START + */ if (defaultHandler) reportDefault(parser, enc, s, next); break; + /* LCOV_EXCL_STOP */ } *eventPP = s = next; switch (ps_parsing) { -- 2.40.0