From 0526776fa9dce2f3a6b1dca038d693b7b0815f19 Mon Sep 17 00:00:00 2001 From: mpolacek Date: Mon, 18 Dec 2017 16:49:59 +0000 Subject: [PATCH] * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is not in effect. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255782 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-warn.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index dd71fd01fe0..820e66aee0e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2017-12-18 Marek Polacek + + * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is + not in effect. + 2017-12-17 Martin Sebor * c-attribs.c (common_handle_aligned_attribute): Avoid issuing diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c index 6045d6e17a9..4246ce3bb3e 100644 --- a/gcc/c-family/c-warn.c +++ b/gcc/c-family/c-warn.c @@ -180,6 +180,9 @@ warn_logical_operator (location_t location, enum tree_code code, tree type, tree low0, low1, low, high0, high1, high, lhs, rhs, tem; bool strict_overflow_p = false; + if (!warn_logical_op) + return; + if (code != TRUTH_ANDIF_EXPR && code != TRUTH_AND_EXPR && code != TRUTH_ORIF_EXPR -- 2.11.4.GIT