[FFmpeg-devel] [PATCH 3/4] avfilter/vf_ccrepack: Constify filter

James Almer jamrial at gmail.com
Thu Jun 29 22:51:00 EEST 2023


On 6/29/2023 4:42 PM, Paul B Mahol wrote:
> On Thu, Jun 29, 2023 at 9:35 PM Andreas Rheinhardt <
> andreas.rheinhardt at outlook.com> wrote:
> 
>> Paul B Mahol:
>>> On Thu, Jun 29, 2023 at 8:18 PM Andreas Rheinhardt <
>>> andreas.rheinhardt at outlook.com> wrote:
>>>
>>>> The discrepancy between the definition and the declaration
>>>> in allfilters.c is actually UB.
>>>>
>>>
>>> I get no such message with ubsan.
>>>
>>
>> UBSan is a runtime UB-detector, not a compile-time UB detector.
>> The earlier code is UB because of 6.2.7 (2) of C11: "All declarations
>> that refer to the same object or function shall have compatible type;
>> otherwise, the behavior is undefined." A type and its const-qualified
>> type are not compatible.
>>
> 
> This is so minor, that it is fully irrelevant.

Msvc was pedantic enough to complain about a double colon, so who knows 
if some compiler would do the same for this.
If the spec states both must match, then adding a "const" is hardly a 
problem.


More information about the ffmpeg-devel mailing list