https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117664

            Bug ID: 117664
           Summary: [15 regression] incompatible pointer type
                    [-Wincompatible-pointer-types]
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

Created attachment 59629
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59629&action=edit
Rperoducer, hopefully self-contained

Hello, very likely this is not a bug report, but some legacy code being sloppy,
so I would appreciate if you could check and maybe point me to a workaround for
the sloppiness. In any case, between Nov. 10 and Nov. 17 there was a commit to
the gcc master that made our included legacy code fail to compile with error
messages like:
$ gcc -I. -g -O2 -c stdhep_mcfio.c 
stdhep_mcfio.c: In function ‘StdHepXdrRead’:
stdhep_mcfio.c:153:51: error: passing argument 3 of ‘mcfioC_Block’ from
incompatible pointer type [-Wincompatible-pointer-types]
  153 |             if (mcfioC_Block(istream,MCFIO_STDHEP,xdr_stdhep_) != -1) {
      |                                                   ^~~~~~~~~~~
      |                                                   |
      |                                                   int (*)(void)
In file included from stdhep_mcfio.c:42:
mcfio_Block.h:10:9: note: expected ‘bool_t (*)(XDR *, int *, int *, char **)’
{aka ‘int (*)(struct __rpc_xdr *, int *, int *, char **)’} but argument is of
type ‘int (*)(void)’
   10 |  bool_t xdr_filtercode(XDR *xdrs, int *blockid, int *ntot, char
**version));
      | 
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
stdhep_mcfio.c:162:52: error: passing argument 3 of ‘mcfioC_Block’ from
incompatible pointer type [-Wincompatible-pointer-types]
  162 |             if (mcfioC_Block(istream,MCFIO_STDHEPM,xdr_stdhep_multi_)
!= -1) {
      |                                                    ^~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    int (*)(void)
mcfio_Block.h:10:9: note: expected ‘bool_t (*)(XDR *, int *, int *, char **)’
{aka ‘int (*)(struct __rpc_xdr *, int *, int *, char **)’} but argument is of
type ‘int (*)(void)’
   10 |  bool_t xdr_filtercode(XDR *xdrs, int *blockid, int *ntot, char
**version));
[...]


The reproducer is attached, I hope that it is self-contained.
Best,
  Juergen

Reply via email to