chkoreff / Fexl

Function EXpression Language (interpreter for functional programs)
http://fexl.com
MIT License
79 stars 4 forks source link

OpenBSD build error #2

Closed ghost closed 12 years ago

ghost commented 12 years ago

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

chkoreff commented 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

chkoreff commented 12 years ago

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.

ghost commented 12 years ago

Builds just fine on OpenBSD now as well. Just had to remove -ldl since OpenBSD doesn't need it. Thanks.

chkoreff commented 12 years ago

Thank you! Looks like I need to try an OpenBSD install somewhere, perhaps a VM.