Z
Zach
I don't understand this warning. From what I've read in K&R this is
valid C:
ll14.c: In function 'process_tokens':
ll14.c:156: warning: suggest parentheses around '&&' within '||'
Relevant code:
if ((((c[0] == 'F' || 'R' || 'O' || 'K')
&& (isdigit(c[1]) || islower(c[1])))
&& (c[2] == '-')
&& (c[3] == '>'))
&& ((c[4] == 'F' || 'R' || 'O' || 'K')
&& (isdigit(c[5]) || islower(c[5]))
|| ((c[4] == 'A') && (c[5] == 'L') && (c[6] == 'L'))
|| ((c[4] == 'F') && (c[5] == 'E') && (c[6] == 'D'))
|| ((c[4] == 'R') && (c[5] == 'O') && (c[6] == 'M'))
|| ((c[4] == 'O') && (c[5] == 'R') && (c[6] == 'I'))
|| ((c[4] == 'K') && (c[5] == 'L') && (c[6] == 'I'))))
Line 156 is:
|| ((c[4] == 'F') && (c[5] == 'E') && (c[6] == 'D'))
Also I don't understand why it complains only about that line and not
the others. Weird.
Zach
valid C:
ll14.c: In function 'process_tokens':
ll14.c:156: warning: suggest parentheses around '&&' within '||'
Relevant code:
if ((((c[0] == 'F' || 'R' || 'O' || 'K')
&& (isdigit(c[1]) || islower(c[1])))
&& (c[2] == '-')
&& (c[3] == '>'))
&& ((c[4] == 'F' || 'R' || 'O' || 'K')
&& (isdigit(c[5]) || islower(c[5]))
|| ((c[4] == 'A') && (c[5] == 'L') && (c[6] == 'L'))
|| ((c[4] == 'F') && (c[5] == 'E') && (c[6] == 'D'))
|| ((c[4] == 'R') && (c[5] == 'O') && (c[6] == 'M'))
|| ((c[4] == 'O') && (c[5] == 'R') && (c[6] == 'I'))
|| ((c[4] == 'K') && (c[5] == 'L') && (c[6] == 'I'))))
Line 156 is:
|| ((c[4] == 'F') && (c[5] == 'E') && (c[6] == 'D'))
Also I don't understand why it complains only about that line and not
the others. Weird.
Zach