[FFmpeg-devel] [PATCH 2/3] avutil/mem_internal: define DECLARE_ALIGNED as C11's _Alignas
Scott Theisen
scott.the.elm at gmail.com
Sat Nov 16 19:45:30 EET 2024
On 11/16/24 01:56, Rémi Denis-Courmont wrote:
> 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)
OK, I missed that. Should the `#include <stdalign.h>` be guarded by
`#if __STDC_VERSION__ < 202311L` then?
More information about the ffmpeg-devel
mailing list