added __attribute__((__malloc__)) for gcc and clang
This commit is contained in:
@@ -67,7 +67,7 @@ void cantProceed(
|
||||
* Will never return NULL otherwise.
|
||||
*/
|
||||
LIBCOM_API void * callocMustSucceed(size_t count, size_t size,
|
||||
const char *errorMessage);
|
||||
const char *errorMessage) EPICS_MALLOC;
|
||||
/** \brief A malloc() which suspends on error.
|
||||
* \param size Size of block to allocate.
|
||||
* \param errorMessage Context added to logged error message
|
||||
@@ -76,7 +76,8 @@ LIBCOM_API void * callocMustSucceed(size_t count, size_t size,
|
||||
* Will always return NULL for a zero length allocation.
|
||||
* Will never return NULL otherwise.
|
||||
*/
|
||||
LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage);
|
||||
LIBCOM_API void * mallocMustSucceed(size_t size, const char *errorMessage)
|
||||
EPICS_MALLOC;
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -63,4 +63,9 @@
|
||||
*/
|
||||
#define EPICS_NORETURN __attribute__((noreturn))
|
||||
|
||||
/*
|
||||
* malloc marker
|
||||
*/
|
||||
#define EPICS_MALLOC __attribute__((__malloc__))
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -69,4 +69,9 @@
|
||||
#define EPICS_NORETURN __attribute__((noreturn))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* malloc marker
|
||||
*/
|
||||
#define EPICS_MALLOC __attribute__((__malloc__))
|
||||
|
||||
#endif /* ifndef compilerSpecific_h */
|
||||
|
||||
@@ -56,6 +56,10 @@
|
||||
# define EPICS_NORETURN
|
||||
#endif
|
||||
|
||||
#ifndef EPICS_MALLOC
|
||||
# define EPICS_MALLOC
|
||||
#endif
|
||||
|
||||
#ifndef EPICS_FUNCTION
|
||||
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) || (defined(__cplusplus) && __cplusplus>=201103L)
|
||||
# define EPICS_FUNCTION __func__
|
||||
|
||||
Reference in New Issue
Block a user