Skip to content

Commit a8a1dc2

Browse files
nicoH. Peter Anvin (Intel)
authored andcommitted
Fix Wbitwise-instead-of-logical warning
`a || b` only evaluates b if a is false. `a | b` always evaluates both a and b. If a and b are of type bool, || is usually what you want, so clang now warns on `|` where both arguments are of type bool. This warning fires once in nasm. It looks like `|` is an (inconsequential) typo of `||`, so use that instead. No intended behavior change.
1 parent 9b101e9 commit a8a1dc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asm/preproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3166,7 +3166,7 @@ if_condition(Token * tline, enum preproc_token ct, const char *dname)
31663166
t = tline = expand_smacro(tline);
31673167

31683168
while (tok_white(t) ||
3169-
(needtype == TOKEN_NUM && (tok_is(t, '-') | tok_is(t, '+'))))
3169+
(needtype == TOKEN_NUM && (tok_is(t, '-') || tok_is(t, '+'))))
31703170
t = t->next;
31713171

31723172
j = tok_is(t, needtype);

0 commit comments

Comments
 (0)