[FFmpeg-devel] [PATCH 2/3] avutil/mem_internal: define DECLARE_ALIGNED as C11's _Alignas

Rémi Denis-Courmont remi at remlab.net
Sat Nov 16 08:56:05 EET 2024


Le perjantaina 15. marraskuuta 2024, 22.09.25 EET Scott Theisen a écrit :
> On 11/15/24 08:47, Rémi Denis-Courmont wrote:
> > Le 15 novembre 2024 12:56:23 GMT+02:00, Zhao Zhili 
<quinkblack at foxmail.com> a écrit :
> >> From: Zhao Zhili <zhilizhao at tencent.com>
> >> 
> >> _Alignas is portable than compiler's specific __attribute__. It do
> >> have a limitation, that _Alignas don't support specify aligment on
> >> the declarations of struct (it works for specify alignment on struct
> >> fields),
> >> which only used by avcodec/cavs, and is removed now.
> > 
> > IIRC, _Alignas() is deprecated by C23. Can't we use the proper c11/c23
> > alignas() instead?
> _Alignas is an alternative spelling of alignas in C23 (
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf page 53).

I think you are missing the point here. It is all in the small prints:

"These alternative keywords are obsolescent features and should not be used 
for new code and development." (C23 §6.4.1 footnote 75)

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the ffmpeg-devel mailing list