After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747869 - gstutils: silence clang's -Wcast-align
gstutils: silence clang's -Wcast-align
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-14 18:42 UTC by Michael Catanzaro
Modified: 2018-11-03 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstutils: silence clang's -Wcast-align (1.34 KB, patch)
2015-04-14 18:42 UTC, Michael Catanzaro
none Details | Review
gstutils: silence clang's -Wcast-align (1.40 KB, patch)
2015-04-26 20:55 UTC, Michael Catanzaro
none Details | Review

Description Michael Catanzaro 2015-04-14 18:42:48 UTC
gstutils.h triggers clang's -Wcast-align warning in every file that includes it. Looks like this code is only compiled when GST_HAVE_UNALIGNED_ACCESS is true, so might as well silence it.
Comment 1 Michael Catanzaro 2015-04-14 18:42:51 UTC
Created attachment 301569 [details] [review]
gstutils: silence clang's -Wcast-align

I'm tempted to use #pragma GCC diagnostic to ignore this warning if it's
added to a future version of GCC, but GCC warns if it doesn't recognize
the parameter passed to the pragma, so we'll silence it for clang only.
Comment 2 Sebastian Dröge (slomo) 2015-04-26 19:03:31 UTC
Comment on attachment 301569 [details] [review]
gstutils: silence clang's -Wcast-align

Makes sense, but can we unconditionally use this here? Or should this be in an #ifdef clang block?
Comment 3 Michael Catanzaro 2015-04-26 19:37:03 UTC
GCC is smart enough to ignore other compilers' pragmas. I don't know what other compilers will do, so if you support other compilers we should check or use #ifdef clang.
Comment 4 Sebastian Dröge (slomo) 2015-04-26 19:47:52 UTC
We do, e.g. MSVC.
Comment 5 Michael Catanzaro 2015-04-26 20:55:23 UTC
Based on [1] I guess MSVC would give a warning, so let's add #ifdefs to be on the safe side.

[1] https://msdn.microsoft.com/en-us/library/d9x1s805.aspx
Comment 6 Michael Catanzaro 2015-04-26 20:55:41 UTC
Created attachment 302395 [details] [review]
gstutils: silence clang's -Wcast-align

I'm tempted to use #pragma GCC diagnostic to ignore this warning if it's
added to a future version of GCC, but GCC warns if it doesn't recognize
the parameter passed to the pragma, so we'll silence it for clang only.
Comment 7 Tim-Philipp Müller 2016-06-02 10:04:18 UTC
What shall we do with this? Bit ugly perhaps, but necessary in this case I guess? Or is it no longer a problem with recent clang versions?
Comment 8 Michael Catanzaro 2016-06-02 11:46:48 UTC
I dunno if it's still necessary -- in WebKit we disabled all warnings coming from external project headers and haven't looked back -- but I would presume so....
Comment 9 GStreamer system administrator 2018-11-03 12:26:52 UTC
-- 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/gstreamer/issues/106.