This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GPOINTER_TO_INT on 64-bit arch: cast from pointer to integer of different size


The problem is that in GTK there's only one way to pass user data into a
callback and that's through a gpointer. So even when what you want to
pass isn't a pointer (in this case an enum) you don't have any good way
to get it there other than using GINT_TO_POINTER and GPOINTER_TO_INT.

In a 64-bit arch, is there any way I can tell the compiler "Yes I really
mean this" when interpreting a pointer as an int? Or some way to extract
the least significant 32 bit of the pointer and then apply
GPOINTER_TO_INT to that?

Chris Moller

Wu Zhou mumbled something on 04/18/2006 01:57 AM:
> I met another error when I try to build the latest cvs source on my ppc64 
> box.  This is general to GPOINTER_TO_INT on 64-bit arch, I guess.
>
> Here is the output message in the building process:
>
>  /usr/bin/gcc -m64 -DPACKAGE_NAME=\"frysk\" -DPACKAGE_TARNAME=\"frysk\" -DPACKAGE_VERSION=\"0.0.1.2006.04.17\" -DPACKAGE_STRING=\"frysk\ 0.0.1.2006.04.17\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"frysk\" -DVERSION=\"0.0.1.2006.04.17\"  -I. -I../../../frysk/frysk-gtk/tlwidgets    -fPIC -DPIC -std=gnu99 -Wall -Werror -I../../../frysk/frysk-gtk/tlwidgets/src/widgets -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libgtk-java -I/usr/include/glib-java   -g -O -MT src/widgets/ftkstripchartx.o -MD -MP -MF "$depbase.Tpo" -c -o src/widgets/ftkstripchartx.o ../../../frysk/frysk-gtk/tlwidgets/src/widgets/ftkstripchartx.c; \
> then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
> cc1: warnings being treated as errors
> ../../../frysk/frysk-gtk/tlwidgets/src/widgets/ftkstripchartx.c: In function ‘ftk_stripchart_button_clicked’:
> ../../../frysk/frysk-gtk/tlwidgets/src/widgets/ftkstripchartx.c:1149: warning: cast from pointer to integer of different size
> ../../../frysk/frysk-gtk/tlwidgets/src/widgets/ftkstripchartx.c: In function ‘ftk_spinbutton_vc’:
> ../../../frysk/frysk-gtk/tlwidgets/src/widgets/ftkstripchartx.c:1224: warning: cast from pointer to integer of different size
> make[2]: *** [src/widgets/ftkstripchartx.o] Error 1
>
> In line 1149 and 1224, there is a macro GPOINTER_TO_INT, trying to convert 
> a type of gpointer (a pointer to void) to gint, on 64-bit arch, gpointer 
> is 64-bit, so there is a warning poped out to complain this.
>
> Maybe we need to report this problem to the upstream?  A temporary 
> work-around is to disable the "-Werror" option.
>
> Any comments?
>
> Thanx
> - Wu Zhou

Attachment: signature.asc
Description: PGP signature

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]