[Geany-Devel] [geany/geany] 0c7cf8: Fix gcc warning 'cast to pointer from integer of different size'

Nick Treleaven nick.treleaven at xxxxx
Thu Aug 15 13:32:07 UTC 2013


On 13/08/2013 01:27, Matthew Brush wrote:
>>>> Note from the Glib docs on GUINT_TO_POINTER "#define
>>> GUINT_TO_POINTER(u)
>>>> ((gpointer) (gulong) (u))"
>>>
>>> On my Windows system that macro doesn't cast to gulong, otherwise there
>>>
>>> wouldn't be a gcc warning. Matt pointed out it may be a GLib bug.
>>
>> What does it cast to? Long is only 32bit on windows anyway.
>>
...
> But yeah, I'm pretty sure that *is* why it doesn't have the additional
> (gulong) cast as claimed and discussed in the documentation, but what's
> curious to me is 1) why is the extra new cast needed above just casting
> to pointer as before (especially casting to wider type), and 2) what
> changed that made this warning popup out of nowhere in code I don't
> think has been touched in quite some time?

It's only needed on Windows. Before I ignored the warning.


More information about the Devel mailing list