[Bug 754755] playbin: Compiler warning with 64bit Windows target MinGW, cast to pointer from integer of different size

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Sep 11 05:55:19 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=754755

--- Comment #4 from Kouhei Sutou <kou at cozmixng.org> ---
If we define a macro, the following result may be helpful:

----
typedef unsigned long   gulong;
typedef void* gpointer;

#ifdef _WIN64
#  include <stdint.h>
typedef unsigned __int64 guint64;
#  define GST_ULONG_TO_POINTER(x) ((gpointer) (guint64) (x))
#else
#  define GST_ULONG_TO_POINTER(x) ((gpointer) (x))
#endif

int
main(void)
{
  gulong x = 0;
  gpointer y;

  y = GST_ULONG_TO_POINTER(x);
  y = (gpointer) x;

  return 0;
}
----

----
% gcc -Wall -Wno-unused-but-set-variable -o a.exe a.c
% i686-w64-mingw32-gcc -Wall -Wno-unused-but-set-variable -o a.exe a.c
% x86_64-w64-mingw32-gcc -Wall -Wno-unused-but-set-variable -o a.exe a.c
a.c: In function 'main':
a.c:19:7: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
   y = (gpointer) x;
       ^
----

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list