Opened 8 years ago

Closed 8 years ago

#12893 closed bug (fixed)

[Patch] Terminal: Fix -Wlogical-not-parentheses

Reported by: mt Owned by: jackburton
Priority: normal Milestone: Unscheduled
Component: Applications/Terminal Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Modify if condition at line 1597 [1], since strcmp() returns 0 > or < 0 on failture, negating it may not be 0.

[1] http://cgit.haiku-os.org/haiku/tree/src/apps/terminal/TermView.cpp?id=8a12a74e81e7969b2b963f95bb27779b80dc9ad4#n1597

/home/haiku/haiku/haiku/src/apps/terminal/TermView.cpp:1597:8: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
                                && !strcmp("encoding",
                                   ^
/home/haiku/haiku/haiku/src/apps/terminal/TermView.cpp:1597:8: note: add parentheses after the '!' to evaluate the comparison first
                                && !strcmp("encoding",
                                   ^
/home/haiku/haiku/haiku/src/apps/terminal/TermView.cpp:1597:8: note: add parentheses around left hand side expression to silence this warning
                                && !strcmp("encoding",
                                   ^

Attachments (1)

0026-Terminal-Fix-Wlogical-not-parentheses.patch (842 bytes ) - added by mt 8 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by mt, 8 years ago

patch: 01

comment:2 by pulkomandy, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev50503.

Note: See TracTickets for help on using tickets.