GNOME Bugzilla – Bug 747869
gstutils: silence clang's -Wcast-align
Last modified: 2018-11-03 12:26:52 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.
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 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?
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.
We do, e.g. MSVC.
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
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.
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?
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....
-- 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.