GNOME Bugzilla – Bug 769167
ahc: fix strict aliasing warnings
Last modified: 2018-11-03 13:53:49 UTC
Created attachment 332119 [details] [review] 0001-ahc-fix-strict-aliasing-warnings.patch gcc strict aliasing can break code that performs type-punning, unless said type punning uses unions. See: http://www.cocoawithlove.com/2008/04/using-pointers-to-recast-in-c-is-bad.html for more details about the UNION_CAST macro that I used.
Is it really needed in this specific case? It doesn't seem necessary as none of the two pointers is ever going to be dereferenced in this scope? Does it create a compiler warning?
In this case, I'm not seeing any bugs resulting from it, as I don't think gcc has much opportunity to optimize. However, it seems like that could change in future version of gcc :). Yes, it is generating a warning. I think we should either fix it or turn off strict aliasing; either way is fine with me.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/412.