This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44279] New: system.h calloc/malloc/realloc VMS size_t vs. __size_t
- From: "jay dot krell at cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 May 2010 04:41:40 -0000
- Subject: [Bug c/44279] New: system.h calloc/malloc/realloc VMS size_t vs. __size_t
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
VMS has:
typedef long unsigned int size_t;
typedef unsigned int __size_t;
void * calloc (__size_t __nmemb, __size_t __size);
void * malloc (__size_t __size);
void * realloc (__void_ptr64 __ptr, __size_t __size);
possibly this is something for fixincludes to deal with.
As a result, gcc/system.h gets warnings/errors here, due to varying
declarations of malloc/calloc/realloc (size_t vs. __size_t, unsigned vs.
unsigned long):
#if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC
extern void *malloc (size_t);
#endif
#if defined (HAVE_DECL_CALLOC) && !HAVE_DECL_CALLOC
extern void *calloc (size_t, size_t);
#endif
#if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC
extern void *realloc (void *, size_t);
#endif
I changed mine to:
#if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC && !defined(__vms)
extern void *malloc (size_t);
#endif
#if defined (HAVE_DECL_CALLOC) && !HAVE_DECL_CALLOC && !defined(__vms)
extern void *calloc (size_t, size_t);
#endif
#if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC && !defined(__vms)
extern void *realloc (void *, size_t);
#endif
perhaps not the best fix.
--
Summary: system.h calloc/malloc/realloc VMS size_t vs. __size_t
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jay dot krell at cornell dot edu
GCC target triplet: alpha-dec-vms
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44279