[FFmpeg-devel] [PATCH] avutil/mem: add av_warn_unused_result

Ganesh Ajjanagadde gajjanagadde at gmail.com
Thu Oct 15 23:38:55 CEST 2015


This adds av_warn_unused_result to functions whose return codes need to
be checked.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavutil/mem.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 2a1e36d..285697c 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -144,6 +144,7 @@ void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
  *          The situation is undefined according to POSIX and may crash with
  *          some libc implementations.
  */
+av_warn_unused_result
 int av_reallocp(void *ptr, size_t size);
 
 /**
@@ -304,6 +305,7 @@ void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem);
  * @return >=0 on success, negative otherwise.
  * @see av_dynarray_add(), av_dynarray2_add()
  */
+av_warn_unused_result
 int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem);
 
 /**
@@ -334,6 +336,7 @@ void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
  * Multiply two size_t values checking for overflow.
  * @return  0 if success, AVERROR(EINVAL) if overflow.
  */
+av_warn_unused_result
 static inline int av_size_mult(size_t a, size_t b, size_t *r)
 {
     size_t t = a * b;
-- 
2.6.1



More information about the ffmpeg-devel mailing list