nagyistoce / cardpeek

Automatically exported from code.google.com/p/cardpeek
Other
1 stars 0 forks source link

Compiler warning: dyntree_model.c:142:12: attention : cast from function call of type ‘gpointer’ to non-matching type ‘long int’ #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add -Wbad-function-cast to CFLAGS
2. make

What is the expected output? What do you see instead?
dyntree_model.c: In function ‘dyntree_model_column_name_to_index’:
dyntree_model.c:142:12: attention : cast from function call of type 
‘gpointer’ to non-matching type ‘long int’ [-Wbad-function-cast]

What version of the product are you using? On what operating system?
current SVN revision

Maybe the best solution is to change the return type of 
dyntree_model_column_name_to_index() from "int" to "long int"

Original issue reported on code.google.com by ludovic....@gmail.com on 15 May 2013 at 11:48

GoogleCodeExporter commented 9 years ago
Yes this warning has been nagging me for a while, but I couldn't fix it. It 
seems that the glib macro GPOINTER_TO_INT actually does not work on all 
platforms. It attempts to convert a (void *) to an (int), but some compilers 
don't like it. I finally found a fix: 

replace GPOINTER_TO_INT(x) with GPOINTER_TO_INT((char *)(x))

I still have to check if it works on all platforms.

Original comment by L...@gmx.com on 16 May 2013 at 10:38

GoogleCodeExporter commented 9 years ago
This is fixed now. Closing the issue.

Original comment by L...@gmx.com on 12 Sep 2013 at 11:58