相关疑难解决方法(0)

为什么Clang警告:''&&'在'||'`中?

我的理解是括号没有区别,所以有没有任何理由(除了"改善"代码清晰度)Clang警告这是一个默认值?我不想添加括号,因为我不喜欢为代码添加代码.

src/websocket.c:420:43: warning: '&&' within '||' [-Wlogical-op-parentheses]
        if (rv == 0 && N != 0 || rv == -1 && errno == ECONNRESET) {
                              ~~ ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
src/websocket.c:420:43: note: place parentheses around the '&&' expression to
      silence this warning
        if (rv == 0 && N != 0 || rv == -1 && errno == ECONNRESET) {
                                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Run Code Online (Sandbox Code Playgroud)

c clang

33
推荐指数
2
解决办法
2万
查看次数

标签 统计

c ×1

clang ×1