GNOME Bugzilla – Bug 346045
Dubious use casts of pointers to ints
Last modified: 2008-08-19 11:24:53 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
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?
Making that change in dependent.c removes the warnings.
I should have said: Making that change in dependent.c removes the warnings for dependent.c.
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.
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
Still here. Still highly dubious. Retitling.
Is this still there ?
Appears gone to me. Andreas?
Assumed fixed.