Open fnclovers opened 2 months ago
I got this error while compiling raytrace, using riscv-toolchain.
src/raytrace.c:102:76: error: suggest parentheses around arithmetic in operand of '^' [-Werror=parentheses] 102 | h->c = s2v(to_fixed( (((h->p.x>>(FP-3)) + g_time) ^ ((h->p.z>>(FP-3))) + g_time) &255));
Must be corrected to h->c = s2v(to_fixed( ((((h->p.x >> (FP-3)) + g_time) ^ ((h->p.z >> (FP-3)) + g_time)) & 255)));.
h->c = s2v(to_fixed( ((((h->p.x >> (FP-3)) + g_time) ^ ((h->p.z >> (FP-3)) + g_time)) & 255)));
Hi, it is a warning, not an error (but you are right, it will be better with the parentheses).
I got this error while compiling raytrace, using riscv-toolchain.
Must be corrected to
h->c = s2v(to_fixed( ((((h->p.x >> (FP-3)) + g_time) ^ ((h->p.z >> (FP-3)) + g_time)) & 255)));
.