Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parentheses error should be fixed. #6

Open
fnclovers opened this issue Aug 18, 2024 · 1 comment
Open

parentheses error should be fixed. #6

fnclovers opened this issue Aug 18, 2024 · 1 comment

Comments

@fnclovers
Copy link

fnclovers commented Aug 18, 2024

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)));.

@BrunoLevy
Copy link
Owner

Hi, it is a warning, not an error (but you are right, it will be better with the parentheses).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants