diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-11-09 21:44:43 -0600 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-11-09 21:44:45 -0600 |
commit | ef52f03556e443672ad1bbecad07fb1549d01e30 (patch) | |
tree | 69aabad8d9ca90483614774d061b9b143bfd5b7c | |
parent | 6a07ddb302fb3e1677aede8ca24cfe0b09c2eeb4 (diff) | |
download | phosphor-time-manager-ef52f03556e443672ad1bbecad07fb1549d01e30.tar.gz phosphor-time-manager-ef52f03556e443672ad1bbecad07fb1549d01e30.zip |
time-config: fix warning on no-effect conditional
operator<< (for iostream) has higher precidence than terinary
operator. Therefore, 'cout << foo ? 1 : 2' would be evaluated
as '(cout << foo) ? 1 : 2' which is always true.
Add parens to ensure the correct evaluation order.
Change-Id: I24ce991ec934c35ca2b244677cacb1a5a738ad76
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
-rw-r--r-- | time-config.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/time-config.cpp b/time-config.cpp index da54581..48bcbd4 100644 --- a/time-config.cpp +++ b/time-config.cpp @@ -528,7 +528,7 @@ int TimeConfig::modifyNtpSettings(const timeModes& newTimeMode) else { std::cout << "SUCCESS. NTP setting is now: " << - (ntpChangeOp) ? "Enabled" : "Disabled"; + ((ntpChangeOp) ? "Enabled" : "Disabled"); // TODO : https://github.com/openbmc/phosphor-time-manager/issues/1 if (ntpChangeOp) |