We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4254 - a _lot_ of strict aliasing warnings
Summary: a _lot_ of strict aliasing warnings
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.0
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-07 08:12 UTC by Ozkan Sezer
Modified: 2019-06-09 01:33 UTC (History)
1 user (show)

See Also:


Attachments
warnings log (12.32 KB, text/plain)
2018-09-07 08:12 UTC, Ozkan Sezer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2018-09-07 08:12:13 UTC
Created attachment 3300 [details]
warnings log

A horde of strict aliasing violation warnings are emitted from joystick
layer, and also from a few other places. This happens with gcc-4.4.7 on
Linux CentOS 6.10.  Some other sysjoystick would possibly have the same
warnings.

Attached my full log here. Example entry:
src/joystick/SDL_joystick.c: In function 'SDL_GetJoystickGUIDInfo':
src/joystick/SDL_joystick.c:1094: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
Comment 1 Ryan C. Gordon 2019-05-18 18:48:54 UTC
Tagging a bunch of bugs with "target-2.0.10" so we have a clear list of things to address before a 2.0.10 release.

Please note that "addressing" one of these bugs might mean deciding to defer on it until after 2.0.10, or resolving it as WONTFIX, etc. This is just here to tell us we should look at it carefully, and soon.

If you have new information or feedback on this issue, this is a good time to add it to the conversation, as we're likely to be paying attention to this specific report in the next few days/weeks.

Thanks!

--ryan.
Comment 2 Sam Lantinga 2019-05-19 18:27:09 UTC
Ozkan, do you have a proposed patch for this?
Comment 3 Ryan C. Gordon 2019-05-19 20:13:34 UTC
For 2.0.10, we can just do -fno-strict-aliasing if this is going to be a problem.
Comment 4 Ozkan Sezer 2019-05-21 05:05:41 UTC
(In reply to Sam Lantinga from comment #2)
> Ozkan, do you have a proposed patch for this?

Nope. not at the moment.

(In reply to Ryan C. Gordon from comment #3)
> For 2.0.10, we can just do -fno-strict-aliasing if this is going to be a
> problem.

Not really a _problem_, just annoyance.
Comment 5 Sam Lantinga 2019-05-22 00:38:33 UTC
Let's use -fno-strict-aliasing. In my reading it seems like if we don't do that we might have subtle optimization related bugs at any time.
Comment 6 Sam Lantinga 2019-06-09 01:33:36 UTC
I added -fno-strict-aliasing as a temporary workaround here:
https://hg.libsdl.org/SDL/rev/1a330416800d

We can come back to this with real fixes to re-enable these compiler optimizations after 2.0.10 ships.