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 4079 - lots of strict aliasing warnings
Summary: lots of strict aliasing warnings
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-12 07:00 UTC by Ozkan Sezer
Modified: 2018-02-13 21:28 UTC (History)
1 user (show)

See Also:


Attachments
warnings log from gcc-4.5.4 (51.77 KB, text/x-log)
2018-02-12 07:00 UTC, Ozkan Sezer
Details
patch to revert typecast assingment changes (46.69 KB, patch)
2018-02-12 14:01 UTC, Ozkan Sezer
Details | Diff
patch to revert typecast assignment changes (46.16 KB, patch)
2018-02-12 18:29 UTC, Ozkan Sezer
Details | Diff
patch to revert typecast assignment changes (46.83 KB, patch)
2018-02-12 22:10 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ozkan Sezer 2018-02-12 07:00:45 UTC
Created attachment 3163 [details]
warnings log from gcc-4.5.4

FYI: A _horde_ of strict aliasing warnings are emitted from older gcc,
such as gcc-4.3 or -4.5, after the recent typecast assignment changes.
Log from gcc-4.5 is attached.
Comment 1 Sam Lantinga 2018-02-12 07:32:59 UTC
*sigh*

These were changed to fix ISO C99 pedantic warnings in GCC 5.

Is there a way to cast from void* to function pointer that works with both compilers in strict mode?
Comment 2 Ozkan Sezer 2018-02-12 07:57:18 UTC
Not that I know of. (apart from 'don't use -pedantic', of course..)
Comment 3 Ozkan Sezer 2018-02-12 14:01:07 UTC
Created attachment 3165 [details]
patch to revert typecast assingment changes

I am using the attached patch to revert typecast assignment changes
for the time being.
Comment 4 mednafen 2018-02-12 18:26:48 UTC
Perhaps memcpy()
Comment 5 Ozkan Sezer 2018-02-12 18:29:55 UTC
Created attachment 3166 [details]
patch to revert typecast assignment changes

(Attaching the correct version of the patch tis time.)
Comment 6 Ozkan Sezer 2018-02-12 22:10:53 UTC
Created attachment 3167 [details]
patch to revert typecast assignment changes

3rd revision of the patch to revert typecast assignment changes:
Also changes the void* typedefs for the two vulkan function pointers
added in vulkan_internal.h into generic C function pointer typedefs.
Comment 7 Sam Lantinga 2018-02-13 21:28:52 UTC
Okay, pedantic warnings are better than strict aliasing warnings.
https://hg.libsdl.org/SDL/rev/e917e911dab6

Thanks!