[FFmpeg-devel] [PATCHv3] avutil/attributes: extend av_uninit to clang

Ganesh Ajjanagadde gajjanagadde at gmail.com
Thu Oct 8 02:54:15 CEST 2015


On Wed, Oct 7, 2015 at 8:44 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Wed, Oct 7, 2015 at 6:22 PM, 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
>>
>> http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7.
>> 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 | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
>> index 5c6b9de..ceb9e29 100644
>> --- a/libavutil/attributes.h
>> +++ b/libavutil/attributes.h
>> @@ -147,6 +147,14 @@
>>
>>  #if defined(__GNUC__) && !defined(__INTEL_COMPILER) &&
>> !defined(__clang__)
>>  #    define av_uninit(x) x=x
>> +#elif defined(__clang__)
>> +#if __has_warning("-Wuninitialized")
>> +#    define av_uninit(x) \
>> +        _Pragma("clang diagnostic push") \
>> +        _Pragma("clang diagnostic ignored \"-Wuninitialized\"") \
>> +        x=x \
>> +        _Pragma("clang diagnostic pop")
>> +#endif
>>  #else
>>  #    define av_uninit(x) x
>>  #endif
>
>
> Doesn't this leave av_uninit undefined if has_warning is false but clang is
> true?

Indeed you are right. Michael clarified that the issue is with the
ccache and clang interaction.
Consider this patch dropped; thanks all for the testing - at least we
now know where things need to be addressed.

>
> Ronald


More information about the ffmpeg-devel mailing list