[FFmpeg-devel] [PATCH] avcodec: add farbfeld encoder
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Tue Jun 4 00:56:21 EEST 2024
Rémi Denis-Courmont:
> Le maanantaina 3. kesäkuuta 2024, 22.29.13 EEST marcus a écrit :
>>> Bogus cast / aliasing violation.
>>
>> I thought qualifiers don't affect aliasing rules in C. Am I wrong?
>
> If they didn't, the compiler wouldn't warn about incompatible pointer type
> conversions in the absence of the explict cast.
>
Wrong: The conversion uint8_t*const*->const uint8_t * const* is safe
(indeed, C++ performs it automatically); the conversion
uint8_t*const*->const uint8_t ** (which is what the cast here does) is
safe from an aliasing point of view, but not
const-correct/-Wcast-qual-correct (cast to const uint8_t * const* instead).
It is a limitation of C not to be like C++ here.
- Andreas
More information about the ffmpeg-devel
mailing list