Wireshark-bugs: [Wireshark-bugs] [Bug 10979] GPOINTER_TO_UINT in C++ code for 64bit Solaris woul
Date: Wed, 25 Feb 2015 10:40:53 +0000

changed bug 10979


What Removed Added
Status UNCONFIRMED RESOLVED
Resolution --- NOTABUG

Comment # 1 on bug 10979 from
Please ignore. On Solaris one need to set PKG_CONFIG_PATH to avoid this
problem.

$ cat test.c 
#include <stdio.h>
#include <glib.h>

int main()
{ 
  gpointer value=(gpointer*)10;
  uint num_val = GPOINTER_TO_UINT(value);

  return 0;
}

$ g++ -m64  test.c -o test `pkg-config --cflags --libs glib-2.0`In file
included from /usr/include/glib-2.0/glib/gtypes.h:34:0,
                 from /usr/include/glib-2.0/glib/galloca.h:34,
                 from /usr/include/glib-2.0/glib.h:32,
                 from test.c:2:
test.c: In function ‘int main()’:
/usr/lib/glib-2.0/include/glibconfig.h:96:48: error: cast from ‘gpointer {aka
void*}’ to ‘guint {aka unsigned int}’ loses precision [-fpermissive]
 #define GPOINTER_TO_UINT(p) ((guint) (guint) (p))
                                                ^
test.c:7:18: note: in expansion of macro ‘GPOINTER_TO_UINT’
   uint num_val = GPOINTER_TO_UINT(value);
                  ^
$ g++ -m64  test.c -o test `PKG_CONFIG_PATH=/usr/lib/64/pkgconfig/ pkg-config
--cflags --libs glib-2.0`

$


You are receiving this mail because:
  • You are watching all bug changes.