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

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Oct 29 12:31:27 CET 2015


On Thu, Oct 29, 2015 at 5:23 AM, wm4 <nfxjfg at googlemail.com> wrote:
> On Thu, 29 Oct 2015 09:17:16 +0100
> Hendrik Leppkes <h.leppkes at gmail.com> wrote:
>
>> On Thu, Oct 29, 2015 at 3:51 AM, Ganesh Ajjanagadde
>> <gajjanagadde at gmail.com> wrote:
>> > On Thu, Oct 15, 2015 at 6:12 PM, Ganesh Ajjanagadde
>> > <gajjanagadde at gmail.com> wrote:
>> >> Some warnings do get triggered that will need to be fixed.
>> >>
>> >> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> >> ---
>> >>  libavutil/opt.h | 2 ++
>> >>  1 file changed, 2 insertions(+)
>> >>
>> >> diff --git a/libavutil/opt.h b/libavutil/opt.h
>> >> index 753434d..5abe963 100644
>> >> --- a/libavutil/opt.h
>> >> +++ b/libavutil/opt.h
>> >> @@ -414,6 +414,7 @@ void av_opt_set_defaults2(void *s, int mask, int flags);
>> >>   * the error code issued by av_opt_set() if a key/value pair
>> >>   * cannot be set
>> >>   */
>> >> +av_warn_unused_result
>> >>  int av_set_options_string(void *ctx, const char *opts,
>> >>                            const char *key_val_sep, const char *pairs_sep);
>> >>
>> >> @@ -444,6 +445,7 @@ int av_set_options_string(void *ctx, const char *opts,
>> >>   * Separators must use characters distinct from option names and from each
>> >>   * other.
>> >>   */
>> >> +av_warn_unused_result
>> >>  int av_opt_set_from_string(void *ctx, const char *opts,
>> >>                             const char *const *shorthand,
>> >>                             const char *key_val_sep, const char *pairs_sep);
>> >> --
>> >> 2.6.1
>> >>
>> >
>> > ping
>>
>> I would argue that failure from these functions is hardly critical,
>> ie. it can fail if an option is not found, and enforcing checks here
>> seems a bit too aggressive to me.
>
> +1
>
> You might often set options on e.g. a codec generically, without caring
> much whether it fails or not. This is because different codecs have
> different options, and those which lack a certain option will work
> without setting it. (Just as an example.)

Thanks for examining, patch dropped.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list