diff options
author | Marek Polacek <polacek@redhat.com> | 2017-12-18 16:49:59 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2017-12-18 16:49:59 +0000 |
commit | 82cfbd01e4870097de5f9ccdae900141b382d70e (patch) | |
tree | 9818c94dac69bd101e0e194d1364bc4651a2ef6b /gcc | |
parent | 066fc7517dc82b00de335c22d6238e434439d237 (diff) | |
download | gcc-82cfbd01e4870097de5f9ccdae900141b382d70e.zip gcc-82cfbd01e4870097de5f9ccdae900141b382d70e.tar.gz gcc-82cfbd01e4870097de5f9ccdae900141b382d70e.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-warn.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index dd71fd0..820e66a 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2017-12-18 Marek Polacek <polacek@redhat.com> + + * c-warn.c (warn_logical_operator): Return early if -Wlogical-op is + not in effect. + 2017-12-17 Martin Sebor <msebor@redhat.com> * 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 6045d6e..4246ce3 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 |