Changes between Initial Version and Version 1 of Ticket #9859


Ignore:
Timestamp:
Aug 3, 2022, 5:59:01 AM (4 years ago)
Author:
Jozef Chutka
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9859 – Description

    initial v1  
    11While compiling ffmpeg (commit 1368b5a) with emscripten 3.1.17, there are two warnings, I thinks maintainers might want to look into:
    22
    3 ```
     3{{{
    44fftools/ffmpeg.c:339:41: warning: macro 'ATOMIC_VAR_INIT' has been marked as deprecated [-Wdeprecated-pragma]
    55static atomic_int transcode_init_done = ATOMIC_VAR_INIT(0);
     
    88#pragma clang deprecated(ATOMIC_VAR_INIT)
    99                                        ^
    10 ```
     10}}}
    1111
    1212To my knowledge, this macro was a part of early draft design for C11 atomic types. It is not needed in C11, and is deprecated in C17 and removed in C23.
     
    1414The other warning is also interesting:
    1515
    16 ```
     16{{{
    1717fftools/ffmpeg_filter.c:898:35: warning: floating-point comparison is always true; constant cannot be represented exactly in type 'float' [-Wliteral-range]
    1818        if (audio_drift_threshold != 0.1)
    1919            ~~~~~~~~~~~~~~~~~~~~~ ^  ~~~
    20 ```
     20}}}
    2121
    2222It turns out that 0.1 is one of the numbers that it is impossible to encode in binary floating point. And according to the message the condition is as good as having `if(true)` in place. Consider using epsilon:
    2323
    24 ```
     24{{{
    2525if (abs(audio_drift_threshold - 0.1) < epsilon)
    26 ```
     26}}}
    2727
    2828The SO helped me with some information https://stackoverflow.com/questions/73203857/ffmpeg-compilation-warnings-atomic-var-init