Open eli-schwartz opened 9 months ago
It also fails with strict-aliasing violations, specifically in the testsuite.
x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -I../GNU -I.. -I../tests -I/usr/include/libxml2 -I/usr/include/tirpc --std=c++14 -g -O2 -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing -Wformat -Werror=format-security -std=c++14 -c -o ddsT.o ddsT.cc
ddsT.cc: In member function ‘void ddsT::ddsT_test()’:
ddsT.cc:239:44: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
239 | vs_iter &vsi = (vs_iter &) vsc;
| ^~~
ddsT.cc:274:44: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
274 | vs_iter &vsi = (vs_iter &) vsc;
| ^~~
ddsT.cc:302:44: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
302 | vs_iter &vsi = (vs_iter &) vsc;
| ^~~
ddsT.cc:303:45: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
303 | vs_iter &vsi2 = (vs_iter &) vsc2;
| ^~~~
cc1plus: some warnings being treated as errors
Originally reported downstream: https://bugs.gentoo.org/878895
OK, I'll look into this. Thanks.
I tried building with these flags:
-flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
The -Werror=* here is important since these indicate cases where the compiler can try to optimize by assuming UB cannot exist.
I got this error:
Seems like there are multiple flex generated files with overlapping definitions that aren't being namespaced.