[FFmpeg-devel] [PATCH] fix few compiler warnings

Mark Thompson sw at jkqxz.net
Sun May 22 12:04:17 CEST 2016


On 22/05/16 02:51, Davinder Singh wrote:
> Subject: [PATCH 6/7] libavcodec/pngenc: fixed assignment discards qualifier
> warning
>
> ---
> libavcodec/pngenc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
> index 00c830e..7f09d6f 100644
> --- a/libavcodec/pngenc.c
> +++ b/libavcodec/pngenc.c
> @@ -271,7 +271,7 @@ static int png_write_row(AVCodecContext *avctx, const uint8_t *data, int size)
> int ret;
>
> s->zstream.avail_in = size;
> - s->zstream.next_in = data;
> + s->zstream.next_in = (Bytef *) data;
> while (s->zstream.avail_in > 0) {
> ret = deflate(&s->zstream, Z_NO_FLUSH);
> if (ret != Z_OK)
> --
> 2.7.4 (Apple Git-66)
> Subject: [PATCH 7/7] libavcodec/tscc: fixed assignment discards qualifier
> warning
>
> ---
> libavcodec/tscc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
> index bd5fe03..4641545 100644
> --- a/libavcodec/tscc.c
> +++ b/libavcodec/tscc.c
> @@ -78,7 +78,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", ret);
> return AVERROR_UNKNOWN;
> }
> - c->zstream.next_in = buf;
> + c->zstream.next_in = (Bytef *) buf;
> c->zstream.avail_in = buf_size;
> c->zstream.next_out = c->decomp_buf;
> c->zstream.avail_out = c->decomp_size;
> --
> 2.7.4 (Apple Git-66)

Neither of these should be needed, because ZLIB_CONST should be defined.

configure:6254:
enabled zlib && add_cppflags -DZLIB_CONST

This works correctly for me:

$ make V=1 libavcodec/tscc.o
gcc -I. -Isrc/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c99 -fomit-frame-pointer -pthread -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL  -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized  -MMD -MF libavcodec/tscc.d -MT libavcodec/tscc.o -c -o libavcodec/tscc.o src/libavcodec/tscc.c
$

Perhaps instead investigate why it isn't working for you?



More information about the ffmpeg-devel mailing list