我的理解是括号没有区别,所以有没有任何理由(除了"改善"代码清晰度)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)