From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable and av_assume() macros
Date: Fri, 16 May 2025 20:39:50 +0200
Message-ID: <AS8P250MB07440FCF5F4903DB689144B58F93A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <b1a1f06f-d709-4448-ac1a-c90d62c55068@gmail.com>
Ramiro Polla:
>
> On 5/16/25 16:06, Andreas Rheinhardt wrote:
>> Andreas Rheinhardt:
>>> Patches attached.
>>>
>>> - Andreas
>>>
>>
>> Will apply this patchset tomorrow unless there are objections.
>
> [PATCH 01/21] avutil/avassert: Add av_unreachable and av_assume() macros
>> diff --git a/libavutil/avassert.h b/libavutil/avassert.h
>> index 1895fb7551..d0d5aa0c7e 100644
>> --- a/libavutil/avassert.h
>> +++ b/libavutil/avassert.h
>> @@ -75,4 +76,45 @@
>> */
>> void av_assert0_fpu(void);
>>
>> +/**
>> + * Asserts that are used as compiler optimization hints depending
>> + * upon ASSERT_LEVEL and NBDEBUG.
>> + *
>> + * Undefined behaviour occurs if execution reaches a point marked
>> + * with av_unreachable() or if a condition used with av_assume()
>> + * is false.
>> + *
>> + * The condition used with av_assume() should not have side-effects
>> + * and should be visible to the compiler.
>> + */
>> +#if defined(ASSERT_LEVEL) ? ASSERT_LEVEL > 0 : !
>> defined(HAVE_AV_CONFIG_H) && !defined(NDEBUG)
>> +#define av_unreachable(msg) \
>> +do { \
>> + av_log(NULL, AV_LOG_PANIC, \
>> + "Code at %s:%d that was supposedly unreachable due to '%s'
>> reached\n", \
>> + __FILE__, __LINE__, msg); \
>
> The message sounds weird (especially that dangling "reached" at the
> end). What about:
> "Reached supposedly unreachable code at %s:%d: %s\n"
> or any other variation where the reason message gets printed at the end.
Will change.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2025-05-16 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 11:58 Andreas Rheinhardt
2025-05-07 17:57 ` softworkz .
2025-05-07 18:29 ` James Almer
2025-05-07 18:54 ` softworkz .
2025-05-07 19:14 ` softworkz .
2025-05-07 23:21 ` Michael Niedermayer
2025-05-07 23:38 ` softworkz .
2025-05-16 14:06 ` Andreas Rheinhardt
2025-05-16 14:52 ` Ramiro Polla
2025-05-16 18:39 ` Andreas Rheinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB07440FCF5F4903DB689144B58F93A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git