• Ganesh Ajjanagadde's avatar
    avutil/attributes: add av_warn_unused_result · 1d4af04a
    Ganesh Ajjanagadde authored
    GCC 3.4 introduced an attribute warn_unused_result to warn when a programmer
    discards the return value. Applying this judiciously across the codebase can help
    in fixing a lot of problems. At a high level, functions which return error codes
    should always be checked. More concretely, consider the functions ff_add_format
    and the like in avfilter/formats.h. A quick examination shows that a large portion
    of libavfilter fails to handle the associated errors, usually AVERROR(ENOMEM).
    The above example was where I observed the utility of this, but it should be
    useful in many places across the code base.
    Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    1d4af04a
attributes.h 4.43 KB