Closed holgersson32644 closed 2 years ago
Hi,
I don't think you can just enable -fstrict-aliasing
and expect it to work. The option allows the compiler to assume that strict aliasing rules are respected in the code, which is certainly not the case.
Why would you need it anyway?
Hi @mickael9, thanks for your reply. :)
Note that this is about explicitly disabling strict aliasing, not enabling it. Strict aliasing is enabled per default on GCC if -O2
is used. Since it appears that ioq3 requires strict aliasing to be disabled, it should explicitly do so in its build system to override the compiler's default.
I just discovered that strict aliasing is already explicitly disabled https://github.com/mickael9/ioq3/blob/c988f7669bd70b59beb384563d4c8304062ae011/Makefile#L321. @holgersson32644 could it be that you ran into this on a system which had it explicitly re-enabled?
@mickael9 @Flowdalic Indeed, my mistake! GCC enables it with -O2
and it's already masked in the Makefile — which we patch in Gentoo to allow using custom CFLAGS (and others). I'm not sure why it didn't hit me earlier though, but it's definetly not a new regression in ioq3.
Hi, I need to disable strict-aliasing while compiling. Otherwise urbanterror compiles and starts properly, but I'm not able to connect to any server.
I'm running Gentoo/Linux with gcc-11.2.1: