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

Scott Theisen scott.the.elm at gmail.com
Fri Nov 15 22:09:25 EET 2024


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).

alignas before C23 is a macro defined in header <stdalign.h> ( C17 
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf page 197) ( 
https://en.cppreference.com/w/c/types ).


More information about the ffmpeg-devel mailing list