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

cmake: only use -fno-strict-aliasing on files requiring it #1159

Closed
wants to merge 2 commits into from

Conversation

illwieckz
Copy link
Member

This flag is there since first commit and it is likely no one remembers why it has been set to begin with.

I experience no difference when removing this.

This was only used on engine build and dll/exe game. This was never used on nexe game.

@illwieckz
Copy link
Member Author

@illwieckz
Copy link
Member Author

So now we know:

engine/qcommon/msg.cpp: In function ‘void MSG_WriteDeltaFloat(msg_t*, float, float)’:
engine/qcommon/msg.cpp:626:24: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  626 |  MSG_WriteBits( msg, * ( int * ) &newV, 32 );
      |                        ^~~~~~~~~~~~~~~
engine/qcommon/msg.cpp: In function ‘float MSG_ReadDeltaFloat(msg_t*, float)’:
engine/qcommon/msg.cpp:635:5: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
  635 |   * ( int * ) &newV = MSG_ReadBits( msg, 32 );
      |     ^~~~~~~~~~~~~~~

@illwieckz illwieckz changed the title cmake: delete forgotten flag cmake: only use -fno-strict-aliasing on files requiring it May 27, 2024
@illwieckz illwieckz force-pushed the illwieckz/forgotten-flag branch 3 times, most recently from d377a3a to 78fbe9b Compare May 27, 2024 19:17
@illwieckz
Copy link
Member Author

illwieckz commented May 27, 2024

Now we only use the disablement flag to build the only three functions requiring it. All other parts of code are now built with the optimization.

This seems to be ready.

@illwieckz illwieckz force-pushed the illwieckz/forgotten-flag branch from 78fbe9b to b405d93 Compare May 27, 2024 19:19
illwieckz added 2 commits May 27, 2024 21:22
This allows to only use the -fno-strict-aliasing compilation flag
on that code, nothing else.
@illwieckz
Copy link
Member Author

Closed in favor of doing the opposite (always using that flag):

@illwieckz illwieckz closed this May 29, 2024
@illwieckz illwieckz deleted the illwieckz/forgotten-flag branch May 29, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant