[libav-devel] [PATCH 2/5] avstring: Const correct the return pointers of strstr-like functions

Luca Barbato lu_zero at gentoo.org
Mon Aug 3 23:46:19 CEST 2015


On 03/08/15 23:14, Martin Storsjö wrote:
> On Mon, 3 Aug 2015, Luca Barbato wrote:
> 
>> ---
>> libavutil/avstring.c | 5 +++--
>> libavutil/avstring.h | 5 +++--
>> 2 files changed, 6 insertions(+), 4 deletions(-)
> 
> This breaks const-correctness when using these functions on non-const
> input data. The standard C functions strstr and similar have the same
> signature as well, taking const pointers, returning a non-const pointer.
> 

I guess it is one of those ambiguous cases, shall we suppress the
warning for this function?

(right now clang complains and it does break const-correctness if the
input is const).

lu



More information about the libav-devel mailing list