[FFmpeg-devel] [PATCH] avfilter/buffersrc: add av_warn_unused_result attributes
gajjanag at mit.edu
Tue Oct 6 12:45:26 CEST 2015
On Tue, Oct 6, 2015 at 4:01 AM, Nicolas George <george at nsup.org> wrote:
> Le quartidi 14 vendémiaire, an CCXXIV, Ganesh Ajjanagadde a écrit :
>> This adds av_warn_unused_result whenever it is relevant.
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> libavfilter/buffersrc.h | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
> I do not have much of an opinion about this. It looks right in principle,
> but warnings sometimes have unexpected advert effects.
It is possible, but at the moment there are only a few warnings
(ffmpeg.c IIRC) that get triggered, and all are stuff that needs to be
cleaned up. Also, at the moment given the documentation, any unchecked
usage should be cleaned up IMHO. We could revisit this in the future
if there are adverse effects; I don't think attributes break user's
code (unless they have -Werror, in which case as pointed above they
need to fix it).
>> -int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
>> +av_warn_unused_result int av_buffersrc_add_frame_flags(AVFilterContext *buffer_src,
>> AVFrame *frame, int flags);
> It is a bit sad to break alignment, though. I would slightly prefer having
> the long attribute on a line by itself:
> int av_yada_yada_yada(argu *ments);
> ... if people are ok with it too. Otherwise, reindenting with the same
> commit seems acceptable in this case.
Missed this cosmetic aspect, will change.
> Nicolas George
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
More information about the ffmpeg-devel