GNOME Bugzilla – Bug 774108
Two warnings while building with mingw64
Last modified: 2016-11-12 08:42:04 UTC
I saw the warnings while doing the Fedora mingw-gstreamer1 [0] build for F25 and rawhide. Harmless warnings. [0] http://koji.fedoraproject.org/koji/buildinfo?buildID=815128
Created attachment 339333 [details] [review] pool: Fix compiler warning on mingw64 gstpoll.c: In function 'release_event': gstpoll.c:239:3: error: suggest parentheses around assignment used as truth value [-Werror=parentheses] if (status = WaitForSingleObject (set->wakeup_event, INFINITE)) { ^~ Signed-off-by: Victor Toso <victortoso@redhat.com>
Created attachment 339334 [details] [review] tests: Fix compile warning on mingw64 Use undef __MSVCRT_VERSION__ for the test as it will defined once again. In file included from ../../libs/gst/net/gstntppacket.c:35:0, from netclock-replay.c:25: ../../config.h:546:0: error: "__MSVCRT_VERSION__" redefined [-Werror] #define __MSVCRT_VERSION__ 0x0601 In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0, from /usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:9, from netclock-replay.c:21: /usr/x86_64-w64-mingw32/sys-root/mingw/include/_mingw.h:220:0: note: this is the location of the previous definition # define __MSVCRT_VERSION__ 0x0700 Signed-off-by: Victor Toso <victortoso@redhat.com>
Comment on attachment 339333 [details] [review] pool: Fix compiler warning on mingw64 Attachment 339333 [details] pushed as 5571ad1 - pool: Fix compiler warning on mingw64
Review of attachment 339334 [details] [review]: ::: tests/misc/netclock-replay.c @@ +23,3 @@ /* We need the internal netclock estimation function to (re)run the code on + captured samples, plus its dependencies for the build to succeed. */ +#undef __MSVCRT_VERSION__ This will fail on non-Windows as it's not defined. The better solution would be to add at the very top of the source file: > #ifdef HAVE_CONFIG_H > #include "config.h" > #endif Before all other includes.
(In reply to Sebastian Dröge (slomo) from comment #4) > Review of attachment 339334 [details] [review] [review]: > > ::: tests/misc/netclock-replay.c > @@ +23,3 @@ > /* We need the internal netclock estimation function to (re)run the code on > + captured samples, plus its dependencies for the build to succeed. */ > +#undef __MSVCRT_VERSION__ > > This will fail on non-Windows as it's not defined. My bad in not testing this properly. > The better solution would > be to add at the very top of the source file: > > > #ifdef HAVE_CONFIG_H > > #include "config.h" > > #endif > > Before all other includes. Ah, sure. I'll submit v2 shortly. Thanks!
Created attachment 339396 [details] [review] tests: Fix compile warning on mingw64 In file included from ../../libs/gst/net/gstntppacket.c:35:0, from netclock-replay.c:25: ../../config.h:546:0: error: "__MSVCRT_VERSION__" redefined [-Werror] #define __MSVCRT_VERSION__ 0x0601 In file included from /usr/x86_64-w64-mingw32/sys-root/mingw/include/crtdefs.h:10:0, from /usr/x86_64-w64-mingw32/sys-root/mingw/include/stdio.h:9, from netclock-replay.c:21: /usr/x86_64-w64-mingw32/sys-root/mingw/include/_mingw.h:220:0: note: this is the location of the previous definition # define __MSVCRT_VERSION__ 0x0700 Signed-off-by: Victor Toso <victortoso@redhat.com>
Attachment 339396 [details] pushed as cb9309f - tests: Fix compile warning on mingw64