This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/44279] New: system.h calloc/malloc/realloc VMS size_t vs. __size_t


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]