You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Jim Apple (Jira)" <ji...@apache.org> on 2019/12/17 02:05:00 UTC
[jira] [Comment Edited] (ARROW-7395) [C++] Logical "or" with
constants is a Clang warning
[ https://issues.apache.org/jira/browse/ARROW-7395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16997790#comment-16997790 ]
Jim Apple edited comment on ARROW-7395 at 12/17/19 2:04 AM:
------------------------------------------------------------
I don't see one without some restructuring churn that feels like the tail wagging the dog. Overall, the code that caused the warning/error, {{if (MACRO1 || MACRO2)}}, doesn't strike me as a code smell, at least not in C code.
was (Author: jbapple):
I don't see one without some restructuring churn that feels like the tail wagging the dog. Overall, the code that caused the warning/error, {{if (MACRO1 || MACRO2)}}, doesn't strike me as a code small, at least not in C code.
> [C++] Logical "or" with constants is a Clang warning
> ----------------------------------------------------
>
> Key: ARROW-7395
> URL: https://issues.apache.org/jira/browse/ARROW-7395
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 0.15.0
> Reporter: Jim Apple
> Assignee: Jim Apple
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> With clang version 9.0.1, the C++ debug build fails with:
> {noformat}
> In file included from /home/jbapple/code/arrow/cpp/src/arrow/vendored/xxhash/xxhash.h:532:
> /home/jbapple/code/arrow/cpp/src/arrow/vendored/xxhash/xxhash.c:810:11: error: use of logical '||' with constant operand [-Werror,-Wconstant-logical-operand]
> if (0 || 0) {
> ^ ~
> /home/jbapple/code/arrow/cpp/src/arrow/vendored/xxhash/xxhash.c:810:11: note: use '|' for a bitwise operation
> if (0 || 0) {
> ^~
> |
> {noformat}
> The simple fix is to add {{-Wno-constant-logical-operand}} to SetupCxxFlags.cmake.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)