[FFmpeg-devel] [PATCH v2] configure: Explicitly check for static_assert

Martin Storsjö martin at martin.st
Fri Mar 22 09:47:09 EET 2024


On Fri, 22 Mar 2024, Andreas Rheinhardt wrote:

> Martin Storsjö:
>> 
>> Both patches seem to work fine with MSVC 19.27 - I vaguely prefer the v2
>> version, which is simpler.
>> 
>> 
>> But to me, we could also just revert the change to
>> libavcodec/ccaption_dec.c, and declare that we require MSVC 19.28
>> instead. MSVC 19.27, when executed with -std:c11 without -nologo, it
>> prints this:
>> 
>>     /std:c11 is a preview implementation of the ISO C11 standard, and
>>     we're eager to hear about bugs and suggestions for improvements.
>>     However, note that these features are provided as-is without support.
>> 
>> And I don't have any specific reasons for wanting to use this compiler -
>> I just tested the lowest version that was supposed to be supported
>> earlier and noted that it had broken recently. So to me, reverting to
>> requiring _Static_assert would be quite ok as well.
>> 
>
> We can actually do both: Test for static_assert and for _Static_assert
> (to exclude MSVC 19.27; is 19.28 still supposed to be a preview
> implementation?).

19.28 no longer has that preview implementation banner, so from there on, 
it should be fine.

> The reason I prefer static_assert in the codebase is that _Static_assert
> is actually deprecated with C23 (although I don't think it will be
> removed any time).

Ah, I see. Right, with that in mind, unifying usage to static_assert 
sounds good.

No strong opinion either way about the configure checks still (or whether 
we should require _Static_assert to be supported), except that strictly 
requiring static_assert seems less kludgy than trying to define it 
ourselves.

// Martin


More information about the ffmpeg-devel mailing list