[FFmpeg-devel] expected 'const uint8_t **' but argument is of type 'uint8_t **'

Michael Karcher ffmpeg
Wed Sep 8 10:10:55 CEST 2010


Am Mittwoch, den 08.09.2010, 09:47 +0200 schrieb Stefano Sabatini:
> we have several of such warnings. To my naive eyes to pass a pointer
> to a non-const area where it is expected a pointer to a const area
> should be perfectly safe, but the compiler (GCC) is not of the same
> opinion.

> Is that a compiler bug? Am I missing something?
It's not a bug, but a common C FAQ (I also made this mistake I first
stumbled over this problem). See here:
  http://c-faq.com/ansi/constmismatch.html

Summary:
passing uint8_t** to const uint8_t** is in fact unsafe, while passing
uint8_t** to const uint8_t* const * would be safe, but C compilers are
not required to be smart enough to know that, but C++ compilers are.

Regards,
  Michael Karcher




More information about the ffmpeg-devel mailing list