summaryrefslogtreecommitdiffstats
path: root/Source/cmSetCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-11 12:18:15 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-11 12:18:15 (GMT)
commitb41a548d86f8989e790f0150abd3eb337e8c03d0 (patch)
treee22e5e910e1b5769e8bcec6fa20ac703df013e55 /Source/cmSetCommand.cxx
parente0df0495e5b313e1f017ebb938c4522db6d5b89c (diff)
downloadCMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.zip
CMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.tar.gz
CMake-b41a548d86f8989e790f0150abd3eb337e8c03d0.tar.bz2
Add parentheses around '&&' between '||' for gcc
The GNU compiler warns about possible operator precedence mistakes and asks for explicit parentheses (-Wparentheses). We add the parentheses to silence the warning. This also fixes one real logic error in the find_package() implementation by correcting expression evaluation order.
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r--Source/cmSetCommand.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index e2714b6..4b361b0 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -134,9 +134,9 @@ bool cmSetCommand
// we should be nice and try to catch some simple screwups if the last or
// next to last args are CACHE then they screwed up. If they used FORCE
// without CACHE they screwed up
- if (args[args.size() - 1] == "CACHE" ||
- args.size() > 1 && args[args.size() - 2] == "CACHE" ||
- force && !cache)
+ if ((args[args.size() - 1] == "CACHE") ||
+ (args.size() > 1 && args[args.size() - 2] == "CACHE") ||
+ (force && !cache))
{
this->SetError("given invalid arguments for CACHE mode.");
return false;