public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add attributes to allocator functions Date: Mon, 30 Jul 2018 08:52:00 -0000 [thread overview] Message-ID: <20180730085223.75498.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=62a5c6b02c4a0353eb024840113a991c357b4c43 commit 62a5c6b02c4a0353eb024840113a991c357b4c43 Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Thu Jul 26 10:52:44 2018 +0200 Add attributes to allocator functions Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Diff: --- newlib/libc/include/stdlib.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index a805736..cb74d77 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -87,7 +87,8 @@ void * bsearch (const void *__key, size_t __nmemb, size_t __size, __compar_fn_t _compar); -void * calloc (size_t __nmemb, size_t __size) _NOTHROW; +void *calloc(size_t, size_t) __malloc_like __result_use_check + __alloc_size2(1, 2) _NOTHROW; div_t div (int __numer, int __denom); void exit (int __status) _ATTRIBUTE ((__noreturn__)); void free (void *) _NOTHROW; @@ -101,7 +102,7 @@ int getsubopt (char **, char * const *, char **); #endif long labs (long); ldiv_t ldiv (long __numer, long __denom); -void * malloc (size_t __size) _NOTHROW; +void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1) _NOTHROW; int mblen (const char *, size_t); int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *); int mbtowc (wchar_t *__restrict, const char *__restrict, size_t); @@ -138,10 +139,10 @@ int _mkstemps_r (struct _reent *, char *, int); char * _mktemp_r (struct _reent *, char *) _ATTRIBUTE ((__deprecated__("the use of `mktemp' is dangerous; use `mkstemp' instead"))); void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t _compar); int rand (void); -void * realloc (void *__r, size_t __size) _NOTHROW; +void *realloc(void *, size_t) __result_use_check __alloc_size(2) _NOTHROW; #if __BSD_VISIBLE void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size2(2, 3); -void * reallocf (void *__r, size_t __size); +void *reallocf(void *, size_t) __result_use_check __alloc_size(2); #endif #if __BSD_VISIBLE || __XSI_VISIBLE >= 4 char * realpath (const char *__restrict path, char *__restrict resolved_path);
reply other threads:[~2018-07-30 8:52 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20180730085223.75498.qmail@sourceware.org \ --to=sh@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).