Closed ghost closed 12 years ago
James Turner wrote, On 04/26/2012 07:08 PM:
Under OpenBSD 5.0 on amd64 with gcc 4.2.1 I get the following build error:
gcc -c -Wall -Werror -ansi -O3 -fPIC src/double.c -o obj/double.o cc1: warnings being treated as errors src/double.c: In function 'Qdouble': src/double.c:27: warning: dereferencing type-punned pointer will break strict-aliasing rules src/double.c: In function 'get_double': src/double.c:44: warning: dereferencing type-punned pointer will break strict-aliasing rules
That's strange, because I saw that error on Ubuntu at one time and found a way to avoid it. Notice my comments in double.c:
Note that we cannot retrieve a double value directly like this: double x = ( (double )&f->R->L );
That yields an error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Instead, we must first get a pointer to double, then dereference the pointer.
Now I gotta figure out why it's happening anyway on other platforms!
Thanks for the feedback James -- I'll do what I can!
-- Patrick
OK James, I'm pretty sure this and the other issue are now resolved. I tested by downloading to a different server, and the build and tests went fine.
But please do let me know, since I don't have access to an Open BSD machine yet.
Builds just fine on OpenBSD now as well. Just had to remove -ldl since OpenBSD doesn't need it. Thanks.
Thank you! Looks like I need to try an OpenBSD install somewhere, perhaps a VM.
Under OpenBSD 5.0 on amd64 with gcc 4.2.1 I get the following build error:
gcc -c -Wall -Werror -ansi -O3 -fPIC src/double.c -o obj/double.o cc1: warnings being treated as errors src/double.c: In function 'Qdouble': src/double.c:27: warning: dereferencing type-punned pointer will break strict-aliasing rules src/double.c: In function 'get_double': src/double.c:44: warning: dereferencing type-punned pointer will break strict-aliasing rules