From patchwork Sat Jun 3 08:01:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9764053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B49B9602B6 for ; Sat, 3 Jun 2017 08:01:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A704028236 for ; Sat, 3 Jun 2017 08:01:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BE37285C7; Sat, 3 Jun 2017 08:01:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4987C28236 for ; Sat, 3 Jun 2017 08:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162AbdFCIBt (ORCPT ); Sat, 3 Jun 2017 04:01:49 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34803 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077AbdFCIBs (ORCPT ); Sat, 3 Jun 2017 04:01:48 -0400 Received: by mail-wm0-f66.google.com with SMTP id d127so22056534wmf.1 for ; Sat, 03 Jun 2017 01:01:47 -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; bh=0Id78NHDM5XBc36KnOTf5kx7YO/PGZ7y0ir+Uux6ePM=; b=Ff3i1u2tZ9iEpgDgXuRI5o6bR9uw326bugK6H5RYyuHqkiq6r+oSS7T6JpgKaC/hQc 5ZSUZsZfD8gNm/NLRoT7dY51hNTimCvk2b3UyOTUtjQaAmpTMxQYgrd9spTYckf0ORbS UkLzv91R8Vi0PAsKqrF4z9KeB0pyHwgW1XXc6ZQhQbLJnCmp4cL1N/rqSbCmKBcDP9+O CuGsso1N6HZT0eqHKQabKQMj+NKG6+9EfN9nJJGGPYmlSwXGW0bGTImdIT6W/Lr2rlHJ yZHKsF3M4oUDMkk0rDrQHAOfEUD0mJBeetPQoukh4hYouaVnWk2xyA6+1H4mk0nJ/jxP HBzw== 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; bh=0Id78NHDM5XBc36KnOTf5kx7YO/PGZ7y0ir+Uux6ePM=; b=oqyi3y4u7jHn0BY6XWMqSeFUUGvjZY73oelD/SXZldRvF/yviXAAv+yU6eErRAEwFJ FGZOirRVxesN3Unx5W3NchRfLxFiHhSoHcEPYC5QriKPJmoWH2kc0ZTvy9gkGWEPr/8V btIpaHSI1xrh4QC/sU1GTeDR+IRcVB/jBh6JW81HNRZs+HtN/ymH9wrBjogcDcS7ZxWf lCekJKXbwPFE3di2EuOrUUtARsKrPYIpROtKG7b5/YcsNdS7N3bseeXcPSPbylj5r3j3 9qEvFKSZxklhWYQ3BBKDl8apULdKkgh7pdoGrYmFuhxma7VJk2AGMSUBa9EHvLG72mbI bjwQ== X-Gm-Message-State: AODbwcD2QORDg7UPMGTlsjCJwybF5mw3F+mgXb5Hg79pGE32Sg+2sqZ5 IVy6/zUSEzcrznIxH9I= X-Received: by 10.80.218.12 with SMTP id z12mr8792471edj.136.1496476906780; Sat, 03 Jun 2017 01:01:46 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:89c:5400:65b4:e9ec:d7a6:723a]) by smtp.gmail.com with ESMTPSA id j7sm1065641edh.36.2017.06.03.01.01.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Jun 2017 01:01:46 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Chris Li , Luc Van Oostenryck Subject: [PATCH v2 5/8] div0: add warning option -Wdiv-by-zero Date: Sat, 3 Jun 2017 10:01:32 +0200 Message-Id: <20170603080135.46477-6-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170603080135.46477-1-luc.vanoostenryck@gmail.com> References: <20170603080135.46477-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Luc Van Oostenryck --- lib.c | 2 ++ lib.h | 1 + 2 files changed, 3 insertions(+) diff --git a/lib.c b/lib.c index e1e6a1cbf..af2ad83a2 100644 --- a/lib.c +++ b/lib.c @@ -225,6 +225,7 @@ int Wdecl = 1; int Wdeclarationafterstatement = -1; int Wdefault_bitfield_sign = 0; int Wdesignated_init = 1; +int Wdiv_by_zero = 1; int Wdo_while = 0; int Winit_cstring = 0; int Wenum_mismatch = 1; @@ -502,6 +503,7 @@ static const struct warning { { "declaration-after-statement", &Wdeclarationafterstatement }, { "default-bitfield-sign", &Wdefault_bitfield_sign }, { "designated-init", &Wdesignated_init }, + { "div-by-zero", &Wdiv_by_zero }, { "do-while", &Wdo_while }, { "enum-mismatch", &Wenum_mismatch }, { "sparse-error", &Wsparse_error }, diff --git a/lib.h b/lib.h index 2c8529f93..820e69476 100644 --- a/lib.h +++ b/lib.h @@ -112,6 +112,7 @@ extern int Wdecl; extern int Wdeclarationafterstatement; extern int Wdefault_bitfield_sign; extern int Wdesignated_init; +extern int Wdiv_by_zero; extern int Wdo_while; extern int Wenum_mismatch; extern int Wsparse_error;