Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 922624 - media-video/mplayer-1.5_p20231206 - mplayer.c: In function 'main': mplayer.c:3539:41: error: passing argument 2 of 'stream_write_buffer' from incompatible pointer type [-Wincompatible-pointer-types]
Summary: media-video/mplayer-1.5_p20231206 - mplayer.c: In function 'main': mplayer.c:...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: c99-porting gcc-14-stable
  Show dependency tree
 
Reported: 2024-01-21 14:32 UTC by ernsteiswuerfel
Modified: 2024-11-11 15:37 UTC (History)
12 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (ppc, 1.5_p20231206) (mplayer-1.5_p20231206:20240121-141015.log,31.34 KB, text/plain)
2024-01-21 14:32 UTC, ernsteiswuerfel
Details
emerge --info (file_922624.txt,6.47 KB, text/plain)
2024-01-21 14:33 UTC, ernsteiswuerfel
Details
two more fixes for libvo/vo_aa.c (mplayer-more-pointer-fixes.patch,665 bytes, patch)
2024-07-06 22:02 UTC, Torsten Kaiser
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2024-01-21 14:32:40 UTC
Created attachment 882779 [details]
build.log (ppc, 1.5_p20231206)

Also happens with 1.5_p20230618, so no regression.

[...]
powerpc-gentoo-linux-musl-gcc -MMD -MP -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -Icompat/atomics/gcc -D_ISOC99_SOURCE -I. -Iffmpeg -Os -mcpu=7450 -mtune=7450 -pipe -fno-tree-vectorize -fno-asynchronous-unwind-tables -maltivec -mabi=altivec -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DPIC -D_REENTRANT -D_REENTRANT -I/usr/include/dvdcss -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DZLIB_CONST -I/usr/include/dvdcss -c -o mplayer.o mplayer.c
In file included from cfg-mplayer.h:27,
                 from mplayer.c:332:
cfg-common.h:301:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  301 |     {"msglevel", msgl_config, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
      |                  ^~~~~~~~~~~
cfg-common.h:314:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  314 |     {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL},
      |                  ^~~~~~~~~~~~~
cfg-common.h:431:19: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
  431 |     { "rawaudio", &demux_rawaudio_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |                   ^
cfg-common.h:432:19: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
  432 |     { "rawvideo", &demux_rawvideo_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |                   ^
cfg-common.h:435:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
  435 |     { "cdda", &cdda_opts, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |               ^
cfg-common.h:448:12: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  448 |     {"mf", mfopts_conf, CONF_TYPE_SUBCONFIG, 0,0,0, NULL},
      |            ^~~~~~~~~~~
cfg-common.h:464:14: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  464 |     {"vivo", vivoopts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |              ^~~~~~~~~~~~~
cfg-common.h:506:16: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  506 |     {"af-adv", audio_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |                ^~~~~~~~~~~~~~~~~
cfg-common.h:509:65: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  509 |     {"vf*", &vf_settings, CONF_TYPE_OBJ_SETTINGS_LIST, 0, 0, 0, &vf_obj_list},
      |                                                                 ^
cfg-common.h:519:16: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  519 |     {"pphelp", pp_help, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
      |                ^~~~~~~
cfg-common.h:525:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  525 |     {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |             ^~~~~~~~~~~~~~~~~~
cfg-common.h:547:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  547 |     {"lavdopts", lavc_decode_opts_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |                  ^~~~~~~~~~~~~~~~~~~~~
cfg-common.h:548:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  548 |     {"lavfdopts",  lavfdopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
      |                    ^~~~~~~~~~~~~~
cfg-mplayer.h:361:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  361 |     {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
      |               ^~~~~~~~~
cfg-mplayer.h:362:14: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  362 |     {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
      |              ^~~~~~~~~
cfg-mplayer.h:363:11: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  363 |     {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
      |           ^~~~~~~~~
cfg-mplayer.h:365:12: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  365 |     {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
      |            ^~~~~~~
mplayer.c: In function 'main':
mplayer.c:3539:41: error: passing argument 2 of 'stream_write_buffer' from incompatible pointer type [-Wincompatible-pointer-types]
 3539 |                 stream_write_buffer(os, &in_size, 4);
      |                                         ^~~~~~~~
      |                                         |
      |                                         int *
In file included from ./mp_core.h:26,
                 from gui/interface.h:23,
                 from mplayer.c:73:
./stream/stream.h:203:53: note: expected 'unsigned char *' but argument is of type 'int *'
  203 | int stream_write_buffer(stream_t *s, unsigned char *buf, int len);
      |                                      ~~~~~~~~~~~~~~~^~~
make: *** [Makefile:730: mplayer.o] Error 1
 * ERROR: media-video/mplayer-1.5_p20231206::gentoo failed (compile phase):
Comment 1 ernsteiswuerfel archtester 2024-01-21 14:33:55 UTC
Created attachment 882780 [details]
emerge --info
Comment 2 Jan Psota 2024-06-02 21:31:04 UTC
Here the same.
Comment 3 Chris Faylor 2024-06-07 16:37:01 UTC
If you just want to get this built then:
CFLAGS=-Wno-incompatible-pointer-types emerge -1 mplayer

will work.  This is, of course, not a fix.
Comment 4 Jason C 2024-06-09 17:56:03 UTC
(In reply to Chris Faylor from comment #3)
> If you just want to get this built then:
> CFLAGS=-Wno-incompatible-pointer-types emerge -1 mplayer
> 
> will work.  This is, of course, not a fix.

I ran into this as well.

Adding CFLAGS=-Wno-incompatible-pointer-types leads to the next error caused by Wno-int-conversion thus to make it build, you need

CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types Wno-int-conversion"

After that, mplayer will build
Comment 5 N. Andrew Walsh 2024-06-13 11:37:02 UTC
Sorry to clog up the bugreport, but I'm stupid :(

What's the command I need to give to work around the issue? Because when I input 'CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types Wno-int-conversion" emerge -1 mplayer' I get an error about a non-working compiler and am told to check my cflag settings.
Comment 6 Octavio Ruiz (Ta^3) 2024-06-22 03:07:25 UTC
(In reply to N. Andrew Walsh from comment #5)
> Sorry to clog up the bugreport, but I'm stupid :(
> 
> What's the command I need to give to work around the issue? Because when I
> input 'CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types Wno-int-conversion"
> emerge -1 mplayer' I get an error about a non-working compiler and am told
> to check my cflag settings.

Just hit this bug. 

@N. Andrew Walsh there is a dash missing on @Jason C comment.

# CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types -Wno-int-conversion" emerge -1av mplayer 

Will work, I can confirm.
Comment 7 Code_Bleu 2024-06-26 14:11:12 UTC
I had the same issue on mplayer as well as dev-ruby/grpc.  I ran the following and it was able to successfully compile.

CFLAGS="${CFLAGS} -Wno-incompatible-pointer-types -Wno-int-conversion" emerge -1av mplayer dev-ruby/grpc
Comment 8 Larry the Git Cow gentoo-dev 2024-07-06 19:54:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76235aeef01e3657daefac65f7d20c362eb71f76

commit 76235aeef01e3657daefac65f7d20c362eb71f76
Author:     Miroslav Šulc <fordfrog@gentoo.org>
AuthorDate: 2024-07-06 19:53:58 +0000
Commit:     Miroslav Šulc <fordfrog@gentoo.org>
CommitDate: 2024-07-06 19:54:07 +0000

    media-video/mplayer: fixed incompatible pointers
    
    Closes: https://bugs.gentoo.org/922624
    Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>

 ...layer-1.5_p20231206-incompatible-pointers.patch | 287 +++++++++++++++++++++
 media-video/mplayer/mplayer-1.5_p20231206.ebuild   |   4 +
 2 files changed, 291 insertions(+)
Comment 9 Torsten Kaiser 2024-07-06 22:02:49 UTC
Created attachment 897238 [details, diff]
two more fixes for libvo/vo_aa.c

Build still failed for me. Probably because of USE=aalib.
Attached patch fixes my build.
Comment 10 Leonid Kopylov 2024-07-07 08:59:04 UTC
(In reply to Torsten Kaiser from comment #9)
> Created attachment 897238 [details, diff] [details, diff]
> two more fixes for libvo/vo_aa.c
> 
> Build still failed for me. Probably because of USE=aalib.
> Attached patch fixes my build.

still fails also for me
Comment 11 Leonid Kopylov 2024-07-07 09:02:07 UTC
(In reply to Torsten Kaiser from comment #9)
> Created attachment 897238 [details, diff] [details, diff]
> two more fixes for libvo/vo_aa.c
> 
> Build still failed for me. Probably because of USE=aalib.
> Attached patch fixes my build.

builds for me with this patch
Comment 12 Andreas K. Hüttel archtester gentoo-dev 2024-10-31 22:19:21 UTC
(In reply to Torsten Kaiser from comment #9)
> Created attachment 897238 [details, diff] [details, diff]
> two more fixes for libvo/vo_aa.c
> 
> Build still failed for me. Probably because of USE=aalib.
> Attached patch fixes my build.

Reopening then
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-10-31 22:22:49 UTC
(In reply to Larry the Git Cow from comment #8)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=76235aeef01e3657daefac65f7d20c362eb71f76
> 
> commit 76235aeef01e3657daefac65f7d20c362eb71f76
> Author:     Miroslav Šulc <fordfrog@gentoo.org>
> AuthorDate: 2024-07-06 19:53:58 +0000
> Commit:     Miroslav Šulc <fordfrog@gentoo.org>
> CommitDate: 2024-07-06 19:54:07 +0000
> 
>     media-video/mplayer: fixed incompatible pointers
>     
>     Closes: https://bugs.gentoo.org/922624
>     Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
> 
>  ...layer-1.5_p20231206-incompatible-pointers.patch | 287
> +++++++++++++++++++++
>  media-video/mplayer/mplayer-1.5_p20231206.ebuild   |   4 +
>  2 files changed, 291 insertions(+)

Casting to the other side (especially quite a bit) requires rationale to make sure it's the right thing to do. I don't want to add even more of these for the remaining failures without such investigation.