[FFmpeg-devel] [PATCH] avutil/crc: add av_warn_unused_result to av_crc_init

Michael Niedermayer michael at niedermayer.cc
Fri Oct 16 03:24:23 CEST 2015


On Thu, Oct 15, 2015 at 07:32:45PM -0400, Ganesh Ajjanagadde wrote:
> This triggers useful warnings in avcodec/mlp that need to be fixed.
> 
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
>  libavutil/crc.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavutil/crc.h b/libavutil/crc.h
> index e86bf1d..75929b2 100644
> --- a/libavutil/crc.h
> +++ b/libavutil/crc.h
> @@ -60,6 +60,7 @@ typedef enum {
>   * @param ctx_size size of ctx in bytes
>   * @return <0 on failure
>   */
> +av_warn_unused_result
>  int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);

this can only fail currently due to invalid/unsupported arguments
being used
a user application which uses only known to be good arguments
does not need to check the return value


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151016/7af2d0a0/attachment.sig>


More information about the ffmpeg-devel mailing list