From patchwork Tue Jun 13 11:08:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Philipp Psurek X-Patchwork-Id: 17047 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 1F03382154; Tue, 13 Jun 2017 13:10:10 +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="cT9XtnDy"; dkim-atps=neutral Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by open-mesh.org (Postfix) with ESMTPS id 7C3BC82129 for ; Tue, 13 Jun 2017 13:09:16 +0200 (CEST) Received: by mail-wr0-x241.google.com with SMTP id e23so29045976wre.3 for ; Tue, 13 Jun 2017 04:09:16 -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=FryEmA0hpOo6uMriLpYShmBZZ9OvTSWlNnNquEV4J5A=; b=cT9XtnDyoxY/kqZxZbmfBGarlAToH5BpcrbvdwynURjPmyGjEmg9AJEX/aOD4U28qn RZNuiIaoyHCXYVc9SPyfSMFpeYStyplXGAP3n0mhQAV/IJ+G7FqteGamWv0hFk3Iq8dJ GNsRgCME1ItgkuH4+osTmNz3QRZhHdWYdcJdKm4iY4uKfLD23FxC9tYozLmjtCKqkEJI BOiwC94CXiAiQvL/3gzlRuKi0RZK7fnJSwV/wGb+I2D+4UcAzq+EdUwwVGlZxJ9WuAPF 3LFwVmGKHuEASI3SbO3As4NlTgZFKOzFd4n3U3BU23yd8VWG7b0kGiJ6ivTlNOloPjWs 9vhQ== 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=FryEmA0hpOo6uMriLpYShmBZZ9OvTSWlNnNquEV4J5A=; b=L1hsUuUm7FOKBzAIw0xJEpRmOXIAZYRpZmUv9e/WrYScX0ra7PzG9VaOFXWWBB+9ak 3v2gGR5jPg2oHo/h7ct+56Rnh3b3D1UEchySwgPVj1LdNMrfPzarCiCoSa2UCMlgHXq9 fk/RpujAHg98T6TRRRq310iJYyJW41PyYhPWccISkZjK4uypd57ooycfbbyAGCXkELZi xVtBRYtvmw0pMM6z0xN9HCo+83QZkL6n6bAyNYANvde7/DQua6EALY/wj45gtL0mhWId J3W2os4DkUtHec4wFoQxnPBk/hKzkJeEGXYsfv9d56evMB+Nl1t6TC1Go7wJxQZ4I3Ed 99ZA== X-Gm-Message-State: AODbwcCfA2+yvzCfQGrRDuEI8aV01PMzgJ0CO1BNfQYML9SinpgjrZTz quhJq6Zx4emmxiw7 X-Received: by 10.28.2.67 with SMTP id 64mr10561728wmc.101.1497352153449; Tue, 13 Jun 2017 04:09:13 -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 r78sm12632312wrb.37.2017.06.13.04.09.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jun 2017 04:09:12 -0700 (PDT) From: Philipp Psurek To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 13 Jun 2017 13:08:24 +0200 Message-Id: <20170613110824.27786-2-philipp.psurek@gmail.com> X-Mailer: git-send-email 2.13.0 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 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..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;