Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for GCC14 #12436

Open
2 of 6 tasks
raiden00pl opened this issue May 31, 2024 · 1 comment
Open
2 of 6 tasks

Support for GCC14 #12436

raiden00pl opened this issue May 31, 2024 · 1 comment

Comments

@raiden00pl
Copy link
Contributor

raiden00pl commented May 31, 2024

Many NuttX configurations doesn't compile correctly with gcc14 and some return new warnings.
Since correcting everything will take some time, I'm opening a new issue to track progress.

Here are the porting instructions: https://gcc.gnu.org/gcc-14/porting_to.html

TODOs

  • new warnings for nimble - example: nrf52832-dk/sdc_nimble
    fixed here porting/npl/nuttx/include/nimble/nimble_npl_os_log.h: fix gcc14 error mynewt-nimble#1795
  • libcxx compilation is broken - example: stm32f4discovery/testlibcxx
  • include/crypto/curve25519.h:42:5: error: implicit declaration of function 'arc4random_buf'
  • include/nuttx/net/netfilter/ip_tables.h:281:24: error: returning 'char *' from a function with incompatible return type 'struct xt_entry_target *'
  • drivers/clk/clk.h:xx:5: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  • drivers/video/v4l2_cap.c:798:3: error: pointer/integer type mismatch in conditional expression [-Wint-conversion]
  • [ ]
@augustofg
Copy link
Contributor

The SPI generic bitbang implementation also fails with GCC 14 due to a function pointer incompatibility:

/home/augusto/repos/lnls/rffe-uc-fw/nuttx/include/nuttx/spi/spi_bitbang.c:257:22: error: assignment to 'bitexchange_t' {aka 'unsigned char (*)(unsigned char,  unsigned int)'} from incompatible pointer type 'uint16_t (*)(uint16_t,  uint32_t)' {aka 'short unsigned int (*)(short unsigned int,  unsigned int)'} [-Wincompatible-pointer-types]
  257 |       priv->exchange = spi_bitexchange0;
      |                      ^
/home/augusto/repos/lnls/rffe-uc-fw/nuttx/include/nuttx/spi/spi_bitbang.c:266:22: error: assignment to 'bitexchange_t' {aka 'unsigned char (*)(unsigned char,  unsigned int)'} from incompatible pointer type 'uint16_t (*)(uint16_t,  uint32_t)' {aka 'short unsigned int (*)(short unsigned int,  unsigned int)'} [-Wincompatible-pointer-types]
  266 |       priv->exchange = spi_bitexchange1;
      |                      ^
/home/augusto/repos/lnls/rffe-uc-fw/nuttx/include/nuttx/spi/spi_bitbang.c:275:22: error: assignment to 'bitexchange_t' {aka 'unsigned char (*)(unsigned char,  unsigned int)'} from incompatible pointer type 'uint16_t (*)(uint16_t,  uint32_t)' {aka 'short unsigned int (*)(short unsigned int,  unsigned int)'} [-Wincompatible-pointer-types]
  275 |       priv->exchange = spi_bitexchange2;
      |                      ^
/home/augusto/repos/lnls/rffe-uc-fw/nuttx/include/nuttx/spi/spi_bitbang.c:284:22: error: assignment to 'bitexchange_t' {aka 'unsigned char (*)(unsigned char,  unsigned int)'} from incompatible pointer type 'uint16_t (*)(uint16_t,  uint32_t)' {aka 'short unsigned int (*)(short unsigned int,  unsigned int)'} [-Wincompatible-pointer-types]
  284 |       priv->exchange = spi_bitexchange3;

The bitexchange_t type is defined here (returns an uint8_t and the dataout argument is also uint8_t):

/* This is the type of the function that can exchange one bit */
typedef CODE uint8_t (*bitexchange_t)(uint8_t dataout, uint32_t holdtime);

But the spi_bitexchange functions have a different signature:

#ifndef SPI_BITBANG_DISABLEMODE0
static uint16_t spi_bitexchange0(uint16_t dataout, uint32_t holdtime);
#endif
#ifndef SPI_BITBANG_DISABLEMODE1
static uint16_t spi_bitexchange1(uint16_t dataout, uint32_t holdtime);
#endif
#ifndef SPI_BITBANG_DISABLEMODE2
static uint16_t spi_bitexchange2(uint16_t dataout, uint32_t holdtime);
#endif
#ifndef SPI_BITBANG_DISABLEMODE3
static uint16_t spi_bitexchange3(uint16_t dataout, uint32_t holdtime);
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants