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

Test program fails to compile with strict-aliasing errors #7143

Closed
eli-schwartz opened this issue Mar 4, 2024 · 0 comments
Closed

Test program fails to compile with strict-aliasing errors #7143

eli-schwartz opened this issue Mar 4, 2024 · 0 comments

Comments

@eli-schwartz
Copy link

FAILED: src/test/CMakeFiles/test-z3.dir/hwf.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -D_EXTERNAL_RELEASE -D_MP_INTERNAL -I/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5_build-abi_x86_64.amd64/src -I/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src  -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=odr  -Werror=return-type  -std=gnu++17 -mfpmath=sse -msse -msse2 -Wall -MD -MT src/test/CMakeFiles/test-z3.dir/hwf.cpp.o -MF src/test/CMakeFiles/test-z3.dir/hwf.cpp.o.d -o src/test/CMakeFiles/test-z3.dir/hwf.cpp.o -c /var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src/test/hwf.cpp
/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src/test/hwf.cpp: In function ‘void bug_is_int()’:
/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src/test/hwf.cpp:106:21: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  106 |     double   val = *(double*)(raw_val);
      |                     ^~~~~~~~~~~~~~~~~~
/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src/test/hwf.cpp:106:14: warning: ‘raw_val’ is used uninitialized [-Wuninitialized]
  106 |     double   val = *(double*)(raw_val);
      |              ^~~
/var/tmp/portage/sci-mathematics/z3-4.12.5/work/z3-z3-4.12.5/src/test/hwf.cpp:105:14: note: ‘raw_val’ declared here
  105 |     unsigned raw_val[2] = { 2147483648u, 1077720461u };
      |              ^~~~~~~
cc1plus: some warnings being treated as errors

Downstream bug report: https://bugs.gentoo.org/879327
Full build log: build.log

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

1 participant