On 06/03/14 11:06, Rémi Denis-Courmont wrote:
> On Thu,  6 Mar 2014 10:42:42 +0100, Luca Barbato <[email protected]>
> wrote:
>> Some compilers prefer __builtin_unreachable() over a normal abort() to
>> mark unreachable branches.
>> ---
>>  doc/APIchanges         | 3 +++
>>  libavutil/attributes.h | 6 ++++++
>>  libavutil/version.h    | 2 +-
>>  3 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/APIchanges b/doc/APIchanges
>> index d6134f9..f5e6da6 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -13,6 +13,9 @@ libavutil:     2013-12-xx
>>  
>>  API changes, most recent first:
>>  
>> +2014-xx-xx - xxxxxxx - lavu 53.06.0 - attributes.h
>> +  Add av_unreachable() for marking unreachable branches.
>> +
>>  2014-xx-xx - xxxxxxx - lavu 53.05.0 - frame.h
>>    Add av_frame_copy() for copying the frame data.
>>  
>> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
>> index d7f2bb5..b030f6a 100644
>> --- a/libavutil/attributes.h
>> +++ b/libavutil/attributes.h
>> @@ -123,4 +123,10 @@
>>  #    define av_noreturn
>>  #endif
>>  
>> +#if AV_GCC_VERSION_AT_LEAST(4,5)
>> +#   define av_unreachable() __builtin_unreachable()
>> +#else
>> +#   define av_unreachable() abort()
>> +#endif
> 
> On many platformss, you will get a more useful failure message with
> assert(0) than abort() - assuming NDEBUG is not defined of course.

Thus why I'm using abort =)

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to