From dc49b0343f91f9a7d85bd4d30f02c103c1a52a72 Mon Sep 17 00:00:00 2001 From: Vlad Grigorescu Date: Fri, 6 May 2016 15:07:05 -0500 Subject: [PATCH] binpac: Add a comment in the generated C++ code for fall through in switch A common BinPAC construct for parsing records is a switch statement, with no breaks between the cases, as control is expected to fall through. Coverity raises an error about this; this commit should fix that. --- tools/binpac/src/pac_record.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/binpac/src/pac_record.cc b/tools/binpac/src/pac_record.cc index 2cd888742a..41a717653d 100644 --- a/tools/binpac/src/pac_record.cc +++ b/tools/binpac/src/pac_record.cc @@ -446,6 +446,7 @@ void RecordDataField::GenParseCode(Output* out_cc, Env* env) out_cc->println("%s = %d;", env->LValue(parsing_state_id), parsing_state_seq()); + out_cc->println("/* fall through */"); out_cc->dec_indent(); out_cc->println("case %d:", parsing_state_seq()); out_cc->inc_indent();