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 748110 - vtdec: fix build error with clang
vtdec: fix build error with clang
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Mac OS
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Reported: 2015-04-18 15:41 UTC by Yujin Lee
Modified: 2015-04-26 17:21 UTC
See Also:
GNOME target: ---
GNOME version: ---

vtdec: fix build error with clang (1.53 KB, patch)
2015-04-18 15:48 UTC, Yujin Lee
none Details | Review
vtdec: fix build error with clang (898 bytes, patch)
2015-04-18 16:01 UTC, Yujin Lee
committed Details | Review

Description Yujin Lee 2015-04-18 15:41:34 UTC
There is a build error when vtdec is compiled with clang.

Making all in sys
/Applications/ -C applemedia
  OBJC     libgstapplemedia_la-plugin.lo
plugin.m:89:7: error: comparison of function 'VTCompressionSessionCreate' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
  if (VTCompressionSessionCreate != NULL) {
      ^~~~~~~~~~~~~~~~~~~~~~~~~~    ~~~~
plugin.m:89:7: note: prefix with the address-of operator to silence this warning
  if (VTCompressionSessionCreate != NULL) {
1 error generated.
make[3]: *** [libgstapplemedia_la-plugin.lo] Error 1
make[2]: *** [applemedia] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Comment 1 Yujin Lee 2015-04-18 15:48:47 UTC
Created attachment 301904 [details] [review]
vtdec: fix build error with clang

This commit fixes a simple build error by clang with by clang with [-Werror,-Wtautological-pointer-compare] options.
Comment 2 Sebastian Dröge (slomo) 2015-04-18 15:58:56 UTC
It's not necessary to subscribe random people to bugs, especially as I'm already getting mails about all bugs anyway.
Comment 3 Sebastian Dröge (slomo) 2015-04-18 16:00:16 UTC
And I think this warning is also wrong, with and without & this should be handled the same AFAIK. If you reference a function symbol by name, it's automatically a pointer to that function.
Comment 4 Yujin Lee 2015-04-18 16:01:23 UTC
Created attachment 301905 [details] [review]
vtdec: fix build error with clang

Previous patch is not valid because it includes unnecessary modification that is not associate with this patch. So, could you please review this patch?
Comment 5 Yujin Lee 2015-04-18 16:33:30 UTC
Thank you for your advice. I am not familiar with this world yet. And I will keep in mind it next time.

I also agree with your opinion about function reference by name. But the compiler still makes a build error at the point. Could you please give me some ideas for the error to be fixed?
Comment 6 Sebastian Dröge (slomo) 2015-04-18 16:42:43 UTC
I think it should be reported to clang as it's IMHO a bug in their code, but also we should just put a & there to silence the warning as the code should be equivalent.
Comment 7 Yujin Lee 2015-04-18 17:34:08 UTC
OK. I will report this bug to clang dev team. And could we apply this patch to master until the bug is fixed in clang side?
Comment 8 Ilya Konstantinov 2015-04-25 12:43:36 UTC
This is intentional clang behavior. It's similar to the convention they have for assignments in parentheses, where you get warnings for:

  if (foo = bar) // change to if ((foo = bar)) to suppress
  if ((foo == bar)) // change to if (foo == bar) to suppress

The provided suppression method is probably an attempt to be less cumbersome than pragmas.

If anything, the clang bug is not taking the -weak_framework flag into account.
Comment 9 Ilya Konstantinov 2015-04-25 12:52:24 UTC
Comment 10 Sebastian Dröge (slomo) 2015-04-26 17:20:49 UTC
Comment on attachment 301905 [details] [review]
vtdec: fix build error with clang

commit a8ea7a9cfb5fd690f459668b7847034b6f2f0f65
Author: Yujin Lee <>
Date:   Sun Apr 19 00:55:50 2015 +0900

    vtdec: fix build error with clang
    This commit fixes a simple build error by clang with
    by clang with [-Werror,-Wtautological-pointer-compare] options.