From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Philipp Psurek Date: Tue, 13 Jun 2017 13:08:24 +0200 Message-Id: <20170613110824.27786-2-philipp.psurek@gmail.com> In-Reply-To: <20170613110824.27786-1-philipp.psurek@gmail.com> References: <20170613103916.27299-1-philipp.psurek@gmail.com> <20170613110824.27786-1-philipp.psurek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: [B.A.T.M.A.N.] [PATCH] batctl: suppress implicit-fallthrough compiler warning List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: b.a.t.m.a.n@lists.open-mesh.org GCC 7.1.0 complains about an intended fallthrough. “__attribute__ ((fallthrough))” in this part of code would suppress this warning. Because older GCC compiler don’t understand this statement attribute and because there is already a comment in the source containing “falls?[ \t-]*thr(ough|u)” we can suppress the warning with the “-Wimplicit-fallthrough=2” warning option. Unintended fallthroughs without a comment would trigger this warning again. To avoid compiler recognition in the Makefile a simply change of the comment is sufficient to suppress the warning. For some reason only stand alone comments mentioned in [1] are recognized so the comment has to be split up into two parts. [1] https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough_003d Signed-off-by: Philipp Psurek --- tp_meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tp_meter.c b/tp_meter.c index 918fb79..eb67ba1 100644 --- a/tp_meter.c +++ b/tp_meter.c @@ -500,7 +500,7 @@ int tp_meter(char *mesh_iface, int argc, char **argv) break; case BATADV_TP_REASON_CANCEL: printf("CANCEL received: test aborted\n"); - /* fall through and print the partial result */ + /* fall through *//* and print the partial result */ case BATADV_TP_REASON_COMPLETE: if (result.test_time > 0) { throughput = result.total_bytes * 1000; -- 2.13.0