calloc not quite matching signature in bfd_add_bfd_to_archive_cache/htab_create_alloc
Jay K
jay.krell@cornell.edu
Sat May 8 04:10:00 GMT 2010
/bin/sh ./libtool --tag=CC --mode=compile alpha-dec-vms-gcc -DHAVE_CONFIG_H -I. -I/src/binutils/src/bfd -DOSF_CORE -I. -I/src/binutils/src/bfd -I/src/binutils/src/bfd/../include -DBINDIR='"/usr/local/bin"' -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -MT archive.lo -MD -MP -MF .deps/archive.Tpo -c -o archive.lo /src/binutils/src/bfd/archive.c
libtool: compile: alpha-dec-vms-gcc -DHAVE_CONFIG_H -I. -I/src/binutils/src/bfd -DOSF_CORE -I. -I/src/binutils/src/bfd -I/src/binutils/src/bfd/../include -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -MT archive.lo -MD -MP -MF .deps/archive.Tpo -c /src/binutils/src/bfd/archive.c -o archive.obj
cc1: warnings being treated as errors
/src/binutils/src/bfd/archive.c: In function '_bfd_add_bfd_to_archive_cache':
/src/binutils/src/bfd/archive.c:318:11: error: passing argument 5 of 'htab_create_alloc' from incompatible pointer type
/src/binutils/src/bfd/../include/hashtab.h:151:15: note: expected 'htab_alloc' but argument is of type 'void * (*)(__size_t, __size_t)'
typedef unsigned int __size_t;
typedef long unsigned int size_t;
provide wrapper:
jbook2:bfd jay$ cvs -z3 diff -u archive.c
Index: archive.c
===================================================================
RCS file: /cvs/src/src/bfd/archive.c,v
retrieving revision 1.66
diff -u -r1.66 archive.c
--- archive.c 1 Apr 2010 09:47:13 -0000 1.66
+++ archive.c 8 May 2010 04:04:46 -0000
@@ -303,6 +303,13 @@
return arc1->ptr == arc2->ptr;
}
+static void*
+_bfd_archive_calloc(size_t count, size_t size)
+/* Wrapper for systems where calloc doesn't take precisely size_t (VMS). */
+{
+ return calloc(count, size);
+}
+
/* Kind of stupid to call cons for each one, but we don't do too many. */
bfd_boolean
@@ -315,7 +322,7 @@
if (hash_table == NULL)
{
hash_table = htab_create_alloc (16, hash_file_ptr, eq_file_ptr,
- NULL, calloc, free);
+ NULL, _bfd_archive_calloc, free);
if (hash_table == NULL)
return FALSE;
bfd_ardata (arch_bfd)->cache = hash_table;
More information about the Binutils
mailing list