On Fri, Jan 11, 2013 at 10:36:11AM -0800, David Severance wrote:
I get the following error compiling on RHEL/CentOS 5.9
on my 64 bit dev
host...
CC dynamic_array.lo
dynamic_array.c: In function ‘vanessa_dynamic_array_split_str_to_int’:
dynamic_array.c:556: warning: cast to pointer from integer of
different size
dynamic_array.c:565: warning: cast to pointer from integer of
different size
This error does not occur my 32 bit dev host. Can this be safely ignored
or is there a 32/64 mismatch problem that needs to be fixed?
Hi David,
It seems to me that the code is wrong and that the integers should
be passed by reference rather than by value.
Would it be possible for you to see if the following works?
diff -r f247977ac83b libvanessa_adt/dynamic_array.c
--- a/libvanessa_adt/dynamic_array.c Thu Jan 24 09:38:19 2013 +0900
+++ b/libvanessa_adt/dynamic_array.c Thu Jan 24 09:47:28 2013 +0900
@@ -561,7 +561,7 @@
while ((sub_string = strchr(string, delimiter)) != NULL) {
*sub_string = '\0';
i = atoi(string);
- if (!vanessa_dynamic_array_add_element(a, (void *) i)) {
+ if (!vanessa_dynamic_array_add_element(a, &i)) {
VANESSA_LOGGER_DEBUG(
"vanessa_dynamic_array_add_element");
return (NULL);
@@ -570,7 +570,7 @@
}
if (*string != '\0') {
i = atoi(string);
- if (!vanessa_dynamic_array_add_element(a, (void *) i)) {
+ if (!vanessa_dynamic_array_add_element(a, &i)) {
VANESSA_LOGGER_DEBUG(
"vanessa_dynamic_array_add_element");
return (NULL);