Skip to content

Commit

Permalink
Fix compiler warnings and a subtle precedence error
Browse files Browse the repository at this point in the history
Most of the warnings are due to -Wunused-but-set-variable, one is due to
-Wdiscarded-qualifiers.
There are couple due to -Wparentheses. Those are noteworthy as the
default precedence w/o the missing paranthesis is not what we want.

e.g.,
We have : 4 - count & 0x03
We want : 4 - (count & 0x03)
We get  : (4 - count) & 0x03

This is because '-' operator has higher precedence than '&' and they
have left-to-right associativity.

Luckily, for the case (count & 0x03), the incorrect precedence also
results in the same result, so it should not affect anything.
  • Loading branch information
Nagendra Tomar committed Mar 31, 2024
1 parent d81c4f2 commit 265c4a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1,509 deletions.
Loading

0 comments on commit 265c4a8

Please sign in to comment.