From 82cfbd01e4870097de5f9ccdae900141b382d70e Mon Sep 17 00:00:00 2001 From: Marek Polacek 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. * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is not in effect. From-SVN: r255782 --- 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.30.2