diff options
author | Peter Wemm <peter@FreeBSD.org> | 2013-07-28 05:06:53 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2013-07-28 05:06:53 +0000 |
commit | f2be5817e9c3cb98a81689acb42dc6549ae0448f (patch) | |
tree | 3c0eb477642c8cddce38b6c98c437cca2f2cbda9 /include/apr_strings.h | |
parent | b641829dcad12c65ed87cf0ebe11100791b9256a (diff) |
Diffstat (limited to 'include/apr_strings.h')
-rw-r--r-- | include/apr_strings.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/apr_strings.h b/include/apr_strings.h index 6b71ff17eb6f9..457217358c8eb 100644 --- a/include/apr_strings.h +++ b/include/apr_strings.h @@ -106,7 +106,11 @@ APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, const char *s); * has 'n' or more characters. If the string might contain * fewer characters, use apr_pstrndup. */ -APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n); +APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Duplicate at most n characters of a string into memory allocated @@ -128,7 +132,11 @@ APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, const char *s, apr_size_t n); * @param n The number of bytes to duplicate * @return The new block of memory */ -APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n); +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n) +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + __attribute__((alloc_size(3))) +#endif + ; /** * Concatenate multiple strings, allocating memory out a pool |