-
Notifications
You must be signed in to change notification settings - Fork 282
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
[BUILD][UNIX] Build fails with strict-aliasing violations #458
Comments
Thank you for reporting the issue. I'm just a user with my own fork. Plus, my version of the messaging system is passing around doubles rather than floats but, that said, I think changing the code to that below a valid solution for official versions of POV-Ray.
Strictly, this is still type-punning, but gcc / g++ guarantee the through a union form works properly. Other rambling. It looks to me like the code here builds up methods to unscramble bytes arbitrary scrambled. Today, on a single machine this very likely only big endian vs little endian differences which can be tested for in other ways. The messaging code was set up to unscramble what might be happening with multiple machines of differing types as well as any scrambling due network transmission. POV-Ray on the whole was never completely fleshed out to run in this many machines across a network manner - as far as I know. Do we still need the arbitrary byte unscrambling? |
Hi, If the optimization level is somewhat higher, I checked it with -O2, it will be reduced to an assignment.
will be optimized to :
At offset
Only a hint. |
Yes, both unions and memcpy are the officially sanctioned way to do this without invoking UB. Both will be optimized by the compiler to the exact machine code that aliasing violations were hoping to produce. I will be honest: I mostly submitted this bug report out of a sense of obligation and for tracking purposes. Given recent activity I did not have high hopes of it being fixed. :D Still, stranger things have happened... the original authors might come back... |
Summary
Tried to build povray with *FLAGS:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
The following error resulted:
POV-Ray Version
Build Environment
The text was updated successfully, but these errors were encountered: