[
https://issues.apache.org/jira/browse/IMPALA-9761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17119265#comment-17119265
]
ASF subversion and git services commented on IMPALA-9761:
---------------------------------------------------------
Commit f39ddb1443eaa588ec85254d0a4aefe95f105b7a in impala's branch
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=f39ddb1 ]
IMPALA-9761: Fix GCC7 ambiguous else warning for gtest macros
On GCC7, a dangling-else warning is firing for code like:
if (cond1) ASSERT_TRUE(cond2)
This is true for several ASSERT_* and EXPECT_* gtest macros.
gtest had some code to avoid warnings for code of this form,
but that code is no longer effective. gtest now disables
the dangling-else warning. Since this is just a matter of
adding braces, this adds braces for all those locations.
For consistency, this may include locations that were not
failing. I found locations by doing:
git grep EXPECT_ | grep if
git grep ASSERT_ | grep if
and manually looking through the output.
Testing:
- Builds successfully
Change-Id: Ieb664afe83736a71508302575e8e66a1b506c985
Reviewed-on: http://gerrit.cloudera.org:8080/15964
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Fix GCC 7 compilation issue: Ambiguous else warning with gtest macros
> ---------------------------------------------------------------------
>
> Key: IMPALA-9761
> URL: https://issues.apache.org/jira/browse/IMPALA-9761
> Project: IMPALA
> Issue Type: Bug
> Components: Backend
> Affects Versions: Impala 4.0
> Reporter: Joe McDonnell
> Priority: Minor
>
> Google test uses a macro to avoid a GCC warning about dangling else
> conditions. It suppresses a warning for code like:
> {code:java}
> if (foo) DCHECK(condition);{code}
> [https://github.com/google/googletest/issues/1119]
> GCC 7 added new warnings and this macro no longer works. The solution is to
> either disable the new warning or use braces. Since using braces is easy, we
> should fix this by adding appropriate braces.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]