Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
libxml2
libxml2-2.7.1-alloc_size.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libxml2-2.7.1-alloc_size.patch of Package libxml2
--- include/libxml/xmlmemory.h +++ include/libxml/xmlmemory.h @@ -63,7 +63,7 @@ * * Returns a pointer to the newly allocated block or NULL in case of error. */ -typedef void *(XMLCALL *xmlMallocFunc)(size_t size); +typedef void *(ATTRIBUTE_ALLOC_SIZE(1) XMLCALL *xmlMallocFunc)(size_t size); /** * xmlReallocFunc: @@ -150,7 +150,7 @@ XMLPUBFUN void XMLCALL xmlMemoryDump (void); XMLPUBFUN void * XMLCALL - xmlMemMalloc (size_t size); + xmlMemMalloc (size_t size) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlMemRealloc (void *ptr,size_t size); XMLPUBFUN void XMLCALL @@ -158,11 +158,11 @@ XMLPUBFUN char * XMLCALL xmlMemoryStrdup (const char *str); XMLPUBFUN void * XMLCALL - xmlMallocLoc (size_t size, const char *file, int line); + xmlMallocLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN void * XMLCALL xmlReallocLoc (void *ptr, size_t size, const char *file, int line); XMLPUBFUN void * XMLCALL - xmlMallocAtomicLoc (size_t size, const char *file, int line); + xmlMallocAtomicLoc (size_t size, const char *file, int line) ATTRIBUTE_ALLOC_SIZE(1); XMLPUBFUN char * XMLCALL xmlMemStrdupLoc (const char *str, const char *file, int line); --- include/libxml/xmlversion.h.in +++ include/libxml/xmlversion.h.in @@ -397,9 +397,19 @@ #ifndef ATTRIBUTE_PRINTF #define ATTRIBUTE_PRINTF(fmt,args) __attribute__((__format__(__printf__,fmt,args))) #endif +#ifndef ATTRIBUTE_ALLOC_SIZE +# if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) +# define ATTRIBUTE_ALLOC_SIZE(x) __attribute__((alloc_size(x))) +# else +# define ATTRIBUTE_ALLOC_SIZE(x) +# endif +#else +# define ATTRIBUTE_ALLOC_SIZE(x) +#endif #else #define ATTRIBUTE_UNUSED #define ATTRIBUTE_PRINTF +#define ATTRIBUTE_ALLOC_SIZE(x) #endif #ifdef __cplusplus
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor