augustofg commented on issue #12436:
URL: https://github.com/apache/nuttx/issues/12436#issuecomment-2230730515

   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`):
   
https://github.com/apache/nuttx/blob/ae0ef9443814efb23a8e97bc8c6968a21a9902b9/include/nuttx/spi/spi_bitbang.h#L78-L80
   
   But the `spi_bitexchange` functions have a different signature:
   
https://github.com/apache/nuttx/blob/ae0ef9443814efb23a8e97bc8c6968a21a9902b9/include/nuttx/spi/spi_bitbang.c#L67-L78


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to