After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346045 - Dubious use casts of pointers to ints
Dubious use casts of pointers to ints
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export MS Excel (tm)
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2006-06-27 18:23 UTC by Andreas J. Guelzow
Modified: 2008-08-19 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2006-06-27 18:23:07 UTC
just a collection of warnings related to potentially problematic casts when compiling gnumeric on a 64bit machine:

sample_datasource.c: In function 'watcher_hash':
sample_datasource.c:73: warning: cast from pointer to integer of different size
sample_datasource.c:73: warning: cast from pointer to integer of different size

ms-formula-read.c: In function 'parse_list_pop':
ms-formula-read.c:598: warning: cast from pointer to integer of different size
ms-formula-write.c: In function 'sheet_pair_hash':
ms-formula-write.c:45: warning: cast from pointer to integer of different size
ms-formula-write.c:45: warning: cast from pointer to integer of different size
ms-formula-write.c: In function 'excel_formula_write_NAME_v7':
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size

dependent.c: In function 'micro_hash_many_resize':
dependent.c:520: warning: cast from pointer to integer of different size
dependent.c: In function 'micro_hash_few_to_many':
dependent.c:566: warning: cast from pointer to integer of different size
dependent.c: In function 'micro_hash_insert':
dependent.c:606: warning: cast from pointer to integer of different size
dependent.c:612: warning: cast from pointer to integer of different size
dependent.c: In function 'micro_hash_remove':
dependent.c:665: warning: cast from pointer to integer of different size
Comment 1 Morten Welinder 2006-06-27 21:12:30 UTC
Those that relate to hashes are generally safe.

could you try changing

#define MICRO_HASH_hash(key) ((guint)(key))

to

#define MICRO_HASH_hash(key) ((guint)GPOINTER_TO_UINT(key))

and see if the warnings go away?
Comment 2 Andreas J. Guelzow 2006-06-27 22:25:44 UTC
Making that change in dependent.c removes the warnings.
Comment 3 Andreas J. Guelzow 2006-06-27 22:26:35 UTC
I should have said:

Making that change in dependent.c removes the warnings for dependent.c.
Comment 4 Morten Welinder 2006-06-28 20:08:06 UTC
Fell free to commit that change as well as the similar ones in watcher_hash
and sheet_pair_hash.

In parse_list_pop, use %p and drop the cast.
Comment 5 Andreas J. Guelzow 2006-06-28 23:21:58 UTC
okay, I have committed some changes to cvs. We are still left with:

ms-formula-write.c: In function 'excel_formula_write_NAME_v7':
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size
ms-formula-write.c:639: warning: cast from pointer to integer of different size

Comment 6 Morten Welinder 2006-11-11 01:51:25 UTC
Still here.  Still highly dubious.  Retitling.
Comment 7 Jody Goldberg 2008-07-09 03:09:32 UTC
Is this still there ?
Comment 8 Morten Welinder 2008-07-09 13:26:35 UTC
Appears gone to me.  Andreas?
Comment 9 Jody Goldberg 2008-08-19 11:24:53 UTC
Assumed fixed.