[FFmpeg-devel] [PATCH 2/2] avfilter/internal: add av_warn_unused_result

Ganesh Ajjanagadde gajjanagadde at gmail.com
Thu Oct 15 05:02:45 CEST 2015


av_warn_unused_result is added to functions whose return status should
be checked. Currently does not trigger any warnings, but should be
useful for future robustness.

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

diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index c07d306..f5c8d38 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -171,6 +171,7 @@ int ff_fmt_is_in(int fmt, const int *fmts);
  * @param log_ctx log context
  * @return >= 0 in case of success, a negative AVERROR code on error
  */
+av_warn_unused_result
 int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx);
 
 /**
@@ -181,6 +182,7 @@ int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ct
  * @param log_ctx log context
  * @return >= 0 in case of success, a negative AVERROR code on error
  */
+av_warn_unused_result
 int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
 
 /**
@@ -191,6 +193,7 @@ int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx);
  * @param log_ctx log context
  * @return >= 0 in case of success, a negative AVERROR code on error
  */
+av_warn_unused_result
 int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
 
 /**
@@ -201,6 +204,7 @@ int ff_parse_time_base(AVRational *ret, const char *arg, void *log_ctx);
  * @param log_ctx log context
  * @return >= 0 in case of success, a negative AVERROR code on error
  */
+av_warn_unused_result
 int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
 
 /**
@@ -213,6 +217,7 @@ int ff_parse_sample_format(int *ret, const char *arg, void *log_ctx);
  * @param log_ctx log context
  * @return >= 0 in case of success, a negative AVERROR code on error
  */
+av_warn_unused_result
 int ff_parse_channel_layout(int64_t *ret, int *nret, const char *arg,
                             void *log_ctx);
 
-- 
2.6.1



More information about the ffmpeg-devel mailing list