[FFmpeg-devel] [PATCH 0/7] convert most of the remaining files to stdatomic

Michael Niedermayer michael at niedermayer.cc
Thu Mar 23 03:01:33 EET 2017


On Wed, Mar 22, 2017 at 08:34:05PM -0300, James Almer wrote:
> This set deals with most of the remaining cases of libavutil/atomic.h usage.
> "make fate THREADS=4" passes here on mingw-w64, but I'm not 100% sure fate
> has proper coverage of some of these functions.
> 
> Only ones remaining are Decklink (It's C++98 and I'm not sure how wise would
> it be to include a C11 header in there, so i'm leaving that to someone else),
> and error_resilience.
> 
> James Almer (7):
>   avcodec/mediacodec: convert to stdatomic
>   avcodec/utils: convert to stdatomic
>   avcodec/parser: convert to stdatomic
>   avformat/format: convert to stdatomic
>   avfilter/avfilter: convert to stdatomic
>   avutil/opencl: convert to stdatomic
>   avcodec/videotoolboxenc: remove unused atomic header
> 
>  libavcodec/mediacodec.c           |  5 ++---
>  libavcodec/mediacodecdec.c        |  1 -
>  libavcodec/mediacodecdec_common.c | 14 ++++++--------
>  libavcodec/mediacodecdec_common.h |  5 +++--
>  libavcodec/parser.c               | 14 ++++++++++----
>  libavcodec/utils.c                | 19 +++++++++++--------
>  libavcodec/videotoolboxenc.c      |  1 -
>  libavfilter/avfilter.c            |  6 ++++--
>  libavformat/format.c              |  9 ++++++---
>  libavutil/opencl.c                |  5 +++--
>  10 files changed, 45 insertions(+), 34 deletions(-)

This breaks building with clang

CC      libavfilter/avfilter.o
CC      libavformat/format.o
CC      libavcodec/parser.o
CC      libavcodec/utils.o
src/libavformat/format.c:68:51: error: address argument to atomic operation must be a pointer to _Atomic type ('AVInputFormat **' (aka 'struct AVInputFormat **') invalid)
    while(p != &format->next && !format->next && !__c11_atomic_compare_exchange_strong(p, &cmp, format, 5, 5))
                                                  ^                                    ~
src/libavformat/format.c:81:51: error: address argument to atomic operation must be a pointer to _Atomic type ('AVOutputFormat **' (aka 'struct AVOutputFormat **') invalid)
    while(p != &format->next && !format->next && !__c11_atomic_compare_exchange_strong(p, &cmp, format, 5, 5))
                                                  ^                                    ~
2 errors generated.
make: *** [libavformat/format.o] Error 1
src/libavfilter/avfilter.c:591:18: error: address argument to atomic operation must be a pointer to _Atomic type ('AVFilter **' (aka 'struct AVFilter **') invalid)
    while(*f || !__c11_atomic_compare_exchange_strong(f, &cmp, filter, 5, 5))
                 ^                                    ~
src/libavfilter/avfilter.c:984:2410: warning: array index 3 is past the end of the array (which contains 3 elements) [-Warray-bounds]
                   !__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (filter->filter->name) && __builtin_constant_p ("pp") && (__s1_len = __builtin_strlen (filter->filter->name), __s2_len = __builtin_strlen ("pp"), (!((size_t)(const void *)((filter->filter->name) + 1) - (size_t)(const void *)(filter->filter->name) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("pp") + 1) - (size_t)(const void *)("pp") == 1) || __s2_len >= 4)) ? __builtin_strcmp (filter->filter->name, "pp") : (__builtin_constant_p (filter->filter->name) && ((size_t)(const void *)((filter->filter->name) + 1) - (size_t)(const void *)(filter->filter->name) == 1) && (__s1_len = __builtin_strlen (filter->filter->name), __s1_len < 4) ? (__builtin_constant_p ("pp") && ((size_t)(const void *)(("pp") + 1) - (size_t)(const void *)("pp") == 1) ? __builtin_strcmp (filter->filter->name, "pp") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("pp"); register int __result = (((__const unsigned char *) (__const char *) (filter->filter->name))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (filter->filter->name))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (filter->filter->name))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (filter->filter->name))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("pp") && ((size_t)(const void *)(("pp") + 1) - (size_t)(const void *)("pp") == 1) && (__s2_len = __builtin_strlen ("pp"), __s2_len < 4) ? (__builtin_constant_p (filter->filter->name) && ((size_t)(const void *)((filter->filter->name) + 1) - (size_t)(const void *)(filter->filter->name) == 1) ? __builtin_strcmp (filter->filter->name, "pp") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (filter->filter->name); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("pp"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("pp"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("pp"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("pp"))[3]); } } __result; }))) : __builtin_strcmp (filter->filter->name, "pp")))); }) ||
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ^      ~
1 warning and 1 error generated.
make: *** [libavfilter/avfilter.o] Error 1
src/libavcodec/parser.c:52:18: error: address argument to atomic operation must be a pointer to _Atomic type ('AVCodecParser **' (aka 'struct AVCodecParser **') invalid)
    while(*f || !__c11_atomic_compare_exchange_strong(f, &cmp, parser, 5, 5))
                 ^                                    ~
1 error generated.
make: *** [libavcodec/parser.o] Error 1
src/libavcodec/utils.c:86:18: error: address argument to atomic operation must be a pointer to _Atomic type ('void *volatile *' invalid)
            if (!__c11_atomic_compare_exchange_strong(mutex, &cmp, tmp, 5, 5)) {
                 ^                                    ~~~~~
src/libavcodec/utils.c:105:9: error: address argument to atomic operation must be a pointer to _Atomic type ('void *volatile *' invalid)
        __c11_atomic_compare_exchange_strong(mutex, mutex, ((void*)0), 5, 5);
        ^                                    ~~~~~
src/libavcodec/utils.c:187:18: error: address argument to atomic operation must be a pointer to _Atomic type ('AVCodec **' (aka 'struct AVCodec **') invalid)
    while(*p || !__c11_atomic_compare_exchange_strong(p, &cmp, codec, 5, 5))
                 ^                                    ~
src/libavcodec/utils.c:2824:15: warning: 'avcodec_decode_video2' is deprecated [-Wdeprecated-declarations]
        ret = avcodec_decode_video2(avctx, avctx->internal->buffer_frame,
              ^
src/libavcodec/utils.c:2229:5: note: 'avcodec_decode_video2' has been explicitly marked deprecated here
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
    ^
src/libavcodec/utils.c:2829:15: warning: 'avcodec_decode_audio4' is deprecated [-Wdeprecated-declarations]
        ret = avcodec_decode_audio4(avctx, avctx->internal->buffer_frame,
              ^
src/libavcodec/utils.c:2338:5: note: 'avcodec_decode_audio4' has been explicitly marked deprecated here
int avcodec_decode_audio4(AVCodecContext *avctx,
    ^
src/libavcodec/utils.c:2981:15: warning: 'avcodec_encode_video2' is deprecated [-Wdeprecated-declarations]
        ret = avcodec_encode_video2(avctx, avctx->internal->buffer_pkt,
              ^
src/libavcodec/utils.c:1970:5: note: 'avcodec_encode_video2' has been explicitly marked deprecated here
int avcodec_encode_video2(AVCodecContext *avctx,
    ^
src/libavcodec/utils.c:2984:15: warning: 'avcodec_encode_audio2' is deprecated [-Wdeprecated-declarations]
        ret = avcodec_encode_audio2(avctx, avctx->internal->buffer_pkt,
              ^
src/libavcodec/utils.c:1824:5: note: 'avcodec_encode_audio2' has been explicitly marked deprecated here
int avcodec_encode_audio2(AVCodecContext *avctx,
    ^
src/libavcodec/utils.c:3866:18: error: address argument to atomic operation must be a pointer to _Atomic type ('AVHWAccel **' (aka 'struct AVHWAccel **') invalid)
    while(*p || !__c11_atomic_compare_exchange_strong(p, &cmp, hwaccel, 5, 5))
                 ^                                    ~
4 warnings and 4 errors generated.
make: *** [libavcodec/utils.o] Error 1
make: Target `all' not remade because of errors.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170323/2930cc50/attachment.sig>


More information about the ffmpeg-devel mailing list