[FFmpeg-devel] [PATCH 1/2] avutil/attributes: extend av_uninit to clang
gajjanagadde at gmail.com
Wed Oct 7 04:52:28 CEST 2015
On Sat, Oct 3, 2015 at 8:38 AM, Ganesh Ajjanagadde
<gajjanagadde at gmail.com> wrote:
> On Sat, Sep 26, 2015 at 1:32 PM, Ganesh Ajjanagadde
> <gajjanagadde at gmail.com> wrote:
>> On Sat, Sep 19, 2015 at 1:00 AM, Ganesh Ajjanagadde
>> <gajjanagadde at gmail.com> wrote:
>>> Commit 6dac8c8327 disabled av_uninit for clang, due to some useless warnings.
>>> The concept of av_uninit is inherently useful though. This patch silences a
>>> bunch of warnings on clang e.g
>>> Furthermore, it should be useful for general usage of av_uninit in future.
>>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>>> libavutil/attributes.h | 6 ++++++
>>> 1 file changed, 6 insertions(+)
>>> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
>>> index 50e8eb3..b4b5f13 100644
>>> --- a/libavutil/attributes.h
>>> +++ b/libavutil/attributes.h
>>> @@ -141,6 +141,12 @@
>>> #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
>>> # define av_uninit(x) x=x
>>> +#elif defined(__clang__)
>>> +# define av_uninit(x) \
>>> + _Pragma("clang diagnostic push") \
>>> + _Pragma("clang diagnostic ignored \"-Wuninitialized\"") \
>>> + x=x \
>>> + _Pragma("clang diagnostic pop")
>>> # define av_uninit(x) x
> been a week, hence ping again.
ping: the reason I persist in this is because (long-term) the only 2
compilers where we can reasonably reach a near "warning is regression"
state and benefit from it are clang and gcc.
More information about the ffmpeg-devel