From patchwork Tue Jun 13 10:39:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philipp Psurek X-Patchwork-Id: 17046 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id EE03F82115; Tue, 13 Jun 2017 13:09:50 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YzOlgbL9"; dkim-atps=neutral Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by open-mesh.org (Postfix) with ESMTPS id AD2748104A for ; Tue, 13 Jun 2017 12:40:06 +0200 (CEST) Received: by mail-wr0-x243.google.com with SMTP id e23so28812023wre.3 for ; Tue, 13 Jun 2017 03:40:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B2+gMd6uGwVSjG23I07bTIMx3xEla26w4iSGotnaTIk=; b=YzOlgbL99gnTf2k5Zebi1Z91kYII+asiqcGyNzE1CWesAY4q/5J2p8C0b1LrPTueZG GoBJKmFddvqEJ7mCEjCCbTzWkNRq35nJ1Jfwv81V5hxcn/nI8ybPKRSRyvjnuIF+T0tK o9+/GZeIqQZ9AxW5DrxGQSzNcOQeYAGY8mv1E/8+4eDf90u5MObuEpQhwmpEiybLzJVf 6ipmntT7k/YitkBsupdYl6ISdO+iWFlQqe+5t8Cf2usLxKjzXuLqISAyitBlAUCWCAen S/7lOUvWjjRlc0xRBuwIVwVm3Pf9wQjYsxy7CHAqGZTlA7HeVAqf7u5Hy80+8vOb2gM+ G+9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B2+gMd6uGwVSjG23I07bTIMx3xEla26w4iSGotnaTIk=; b=kcWGl0In6pEejrlIgvKhe0+W+FPGCbZQTjCaGspFAZ40EOe0zeCEr7zSzWB5juhLgv PbtU2a8kLNSiyjRmX2YW6+rIN5YlWdkpsh7WwZR28PUG9Z1dm9qijuari0Gt7x1TZIrP VyO15xem/3Ut670NKq3uPcnuLbtLq42DnT3BCBdkV7hvtwR0Zjh5dyaTqDF+me7iq2Ux pcoX59jLhWp4kWslHPeBguGt+AIygxyVyV/prDavbkKnP4TnWOi2G2hnkDUk6uOKoNho 2Bjk4pFmNBEzP3O04M96T/V+LS+XeFd+6HftLVEDAlKvhExU9T0gpJgJFn8QWGyGvhmT FCCg== X-Gm-Message-State: AKS2vOzhPsBn6oJ+iCzr71a5rOAhTFvOOEGGVfdcNbPIoEnucgsYotzg i45m/TASAxcYZGdJ X-Received: by 10.28.134.212 with SMTP id i203mr1176940wmd.112.1497350406117; Tue, 13 Jun 2017 03:40:06 -0700 (PDT) Received: from soli.hausnetz (dslb-088-077-242-209.088.077.pools.vodafone-ip.de. [88.77.242.209]) by smtp.gmail.com with ESMTPSA id o7sm3181040wmd.0.2017.06.13.03.40.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jun 2017 03:40:05 -0700 (PDT) From: Philipp Psurek To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 13 Jun 2017 12:39:16 +0200 Message-Id: <20170613103916.27299-2-philipp.psurek@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170613103916.27299-1-philipp.psurek@gmail.com> References: <4393196.oYPnlPzS5o@prime> <20170613103916.27299-1-philipp.psurek@gmail.com> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH] batctl: suppress implicit-fallthrough compiler warning X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" 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..bd7fdb4 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 */ + /* fallthrough *//* and print the partial result */ case BATADV_TP_REASON_COMPLETE: if (result.test_time > 0) { throughput = result.total_bytes * 1000;