From: Nicolas George <george@nsup.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [RFC] Remove use of av_uninit
Date: Fri, 11 Apr 2025 13:24:02 +0200
Message-ID: <Z_j70pj0WIR10MvV@phare.normalesup.org> (raw)
In-Reply-To: <tencent_91DE67ECAAAAD33A5C5C4B9A263650882606@qq.com>
Zhao Zhili (HE12025-04-11):
> Background:
>
> 1. There is a av_uninit macro which suppress uninitialized variable warning
>
> #if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
> # define av_uninit(x) x=x
> #else
> # define av_uninit(x) x
> #endif
Yes.
> 2. Declaration after statement coding style is allowed now
I fail to see the connection. Oh, reading further, I guess you think
moving the declaration of the variable will be enough to let the
compiler know the variable is not used and silence the warning. I
strongly doubt it might have that effect.
> 3. There is a crash fixed by ab792634197 which is related to av_uninit, and I have confronted it again recently
So, what does it prove? It proves that 16 years ago (e658657528d) Diego
silenced a warning without making sure the logic itself was sound.
Which is exactly what you are proposing to do right now in a different
way.
> 1. Deprecated av_uninit and removed it in the future
>
> 2. Remove usage in current code
Not before or without 3.
> 3. When there is uninitiated variable warning
>
> a. Declare variable when need if it’s possible, so it can be initiated at the same time
> b. Use valid default value if there is
> c. If there is no valid default value, or you think the variable never being used uninitialized, assign an insane value and add assert before use if
>
> av_assert1(value != invalid_value);
Are you volunteering to do that huge work?
Running FATE with valgrind and no optimization seems like a quicker way
of finding the real bugs.
Regards,
--
Nicolas George
_______________________________________________
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-04-11 11:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 10:32 Zhao Zhili
2025-04-11 11:24 ` Nicolas George [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=Z_j70pj0WIR10MvV@phare.normalesup.org \
--to=george@nsup.org \
--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