Skip to content

Compile fails with gcc-15 and c23 #36

@heitbaum

Description

@heitbaum

BUILD      lg-gpio (target)
    TOOLCHAIN      manual
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgGpio.o lgGpio.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgHdl.o lgHdl.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgI2C.o lgI2C.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgNotify.o lgNotify.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgPthAlerts.o lgPthAlerts.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgSerial.o lgSerial.c
/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/toolchain/bin/armv7ve-libreelec-linux-gnueabihf-gcc -march=armv7ve -mtune=cortex-a7 -mabi=aapcs-linux -Wno-psabi -Wa,-mno-warn-deprecated -mfloat-abi=hard -mfpu=neon-vfpv4 -Wall -pipe  -O2 -fomit-frame-pointer -DNDEBUG -I/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-RPi2.arm-13.0-devel/build/lg-gpio-0.2.2 -O3 -Wall -pthread -fpic    -c -o lgSPI.o lgSPI.c
lgHdl.c: In function 'lgHdlFree':
lgHdl.c:409:36: error: too many arguments to function 'h->destructor'; expected 0, have 1
  409 |       if (h->destructor != NULL) (h->destructor)(h->obj);
      |                                  ~~^~~~~~~~~~~~~ ~~~~~~
lgHdl.c:60:13: note: declared here
   60 |    callbk_t destructor;    // used to correctly free object resources
      |             ^~~~~~~~~~
make: *** [<builtin>: lgHdl.o] Error 1
make: *** Waiting for unfinished jobs....
lgNotify.c: In function 'lgNotifyOpenWithSize':
lgNotify.c:126:59: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
  126 |       LG_HDL_TYPE_NOTIFY, sizeof(lgNotify_t), (void**)&h, _notifyClose);
      |                                                           ^~~~~~~~~~~~
      |                                                           |
      |                                                           void (*)(lgNotify_t *)
In file included from lgNotify.c:41:
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(lgNotify_t *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgNotify.c:58:13: note: '_notifyClose' declared here
   58 | static void _notifyClose(lgNotify_t *h)
      |             ^~~~~~~~~~~~
In file included from lgNotify.c:38:
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
lgNotify.c: In function 'lgNotifyOpenInBand':
lgNotify.c:181:59: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
  181 |       LG_HDL_TYPE_NOTIFY, sizeof(lgNotify_t), (void**)&h, _notifyClose);
      |                                                           ^~~~~~~~~~~~
      |                                                           |
      |                                                           void (*)(lgNotify_t *)
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(lgNotify_t *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgNotify.c:58:13: note: '_notifyClose' declared here
   58 | static void _notifyClose(lgNotify_t *h)
      |             ^~~~~~~~~~~~
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
make: *** [<builtin>: lgNotify.o] Error 1
lgI2C.c: In function 'lgI2cOpen':
lgI2C.c:877:59: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
  877 |       LG_HDL_TYPE_I2C, sizeof(lgI2cObj_t), (void **)&i2c, _lgI2cClose);
      |                                                           ^~~~~~~~~~~
      |                                                           |
      |                                                           void (*)(struct <anonymous> *)
In file included from lgI2C.c:39:
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(struct <anonymous> *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgI2C.c:128:13: note: '_lgI2cClose' declared here
  128 | static void _lgI2cClose(lgI2cObj_p i2c)
      |             ^~~~~~~~~~~
In file included from lgI2C.c:36:
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
make: *** [<builtin>: lgI2C.o] Error 1
lgGpio.c: In function 'lgGpiochipOpen':
lgGpio.c:738:61: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
  738 |       LG_HDL_TYPE_GPIO, sizeof(lgChipObj_t), (void**)&chip, _lgGpiochipClose);
      |                                                             ^~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             void (*)(void *)
In file included from lgGpio.c:46:
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(void *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgGpio.c:88:13: note: '_lgGpiochipClose' declared here
   88 | static void _lgGpiochipClose(void *objPtr)
      |             ^~~~~~~~~~~~~~~~
In file included from lgGpio.c:42:
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
lgGpio.c: In function 'lgGpioSetAlertsFunc':
lgGpio.c:1643:26: error: assignment to 'callbk_t' {aka 'void (*)(void)'} from incompatible pointer type 'lgGpioAlertsFunc_t' {aka 'void (*)(int,  struct lgGpioAlert_s *, void *)'} [-Wincompatible-pointer-types]
 1643 |          GPIO->alertFunc = cbf;
      |                          ^
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
lgpio.h:419:16: note: 'lgGpioAlertsFunc_t' declared here
  419 | typedef void (*lgGpioAlertsFunc_t)  (int           num_alerts,
      |                ^~~~~~~~~~~~~~~~~~
lgGpio.c: In function 'lgGpioSetSamplesFunc':
lgGpio.c:1658:22: error: assignment to 'callbk_t' {aka 'void (*)(void)'} from incompatible pointer type 'lgGpioAlertsFunc_t' {aka 'void (*)(int,  struct lgGpioAlert_s *, void *)'} [-Wincompatible-pointer-types]
 1658 |    lgGpioSamplesFunc = cbf;
      |                      ^
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
lgpio.h:419:16: note: 'lgGpioAlertsFunc_t' declared here
  419 | typedef void (*lgGpioAlertsFunc_t)  (int           num_alerts,
      |                ^~~~~~~~~~~~~~~~~~
make: *** [<builtin>: lgGpio.o] Error 1
lgSPI.c: In function 'lgSpiOpen':
lgSPI.c:118:59: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
  118 |       LG_HDL_TYPE_SPI, sizeof(lgSpiObj_t), (void **)&spi, _lgSpiClose);
      |                                                           ^~~~~~~~~~~
      |                                                           |
      |                                                           void (*)(struct <anonymous> *)
In file included from lgSPI.c:40:
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(struct <anonymous> *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgSPI.c:70:13: note: '_lgSpiClose' declared here
   70 | static void _lgSpiClose(lgSpiObj_p spi)
      |             ^~~~~~~~~~~
In file included from lgSPI.c:37:
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
lgPthAlerts.c: In function 'emit':
lgPthAlerts.c:242:7: error: too many arguments to function 'lgGpioSamplesFunc'; expected 0, have 3
  242 |       (lgGpioSamplesFunc)(i, aBuf, lgGpioSamplesUserdata);
      |       ^                   ~
lgPthAlerts.c: In function 'lgPthAlert':
lgPthAlerts.c:541:31: error: too many arguments to function 'p->state->alertFunc'; expected 0, have 3
  541 |                      (p->state->alertFunc)(count-gpiobasecount,
      |                      ~~~~~~~~~^~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
In file included from lgPthAlerts.c:39:
lgGpio.h:42:13: note: declared here
   42 |    callbk_t alertFunc;
      |             ^~~~~~~~~
lgPthAlerts.c:568:34: error: too many arguments to function 'p->state->alertFunc'; expected 0, have 3
  568 |                         (p->state->alertFunc)(count-gpiobasecount,
      |                         ~~~~~~~~~^~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
lgGpio.h:42:13: note: declared here
   42 |    callbk_t alertFunc;
      |             ^~~~~~~~~
make: *** [<builtin>: lgSPI.o] Error 1
make: *** [<builtin>: lgPthAlerts.o] Error 1
lgSerial.c: In function 'lgSerialOpen':
lgSerial.c:98:30: error: passing argument 4 of 'lgHdlAlloc' from incompatible pointer type [-Wincompatible-pointer-types]
   98 |                (void**)&ser, _lgSerialClose);
      |                              ^~~~~~~~~~~~~~
      |                              |
      |                              void (*)(struct <anonymous> *)
In file included from lgSerial.c:40:
lgHdl.h:45:52: note: expected 'callbk_t' {aka 'void (*)(void)'} but argument is of type 'void (*)(struct <anonymous> *)'
   45 |    (int type, int objSize, void **objPtr, callbk_t destructor);
      |                                           ~~~~~~~~~^~~~~~~~~~
lgSerial.c:48:13: note: '_lgSerialClose' declared here
   48 | static void _lgSerialClose(lgSerialObj_p ser)
      |             ^~~~~~~~~~~~~~
In file included from lgSerial.c:37:
lgpio.h:377:16: note: 'callbk_t' declared here
  377 | typedef void (*callbk_t) ();
      |                ^~~~~~~~
make: *** [<builtin>: lgSerial.o] Error 1


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions