orangepi-xunlong / wiringOP

wiringPi for Orange Pi
GNU Lesser General Public License v3.0
394 stars 189 forks source link

Fix empty return value in orangepi_set_gpio_mode in wiringPi.c #115

Open 7Ji opened 1 month ago

7Ji commented 1 month ago

Call 'return' without an actual value in a function with return value, while allowed in older GCC, is not allowed and strictly forbidden when using newer GCC

Replacing it to 'exit(1)' to stick to the similar behaviour in the same function

This fixes the following error when compiling wiringPi with GCC 14:

wiringPi.c:7212:49: error: ‘return’ with no value, in function returning non-void [-Wreturn-mismatch]
 7212 |                                                 return;
      |                                                 ^~~~~~
wiringPi.c:6362:5: note: declared here
 6362 | int orangepi_set_gpio_mode(int pin, int mode)
      |     ^~~~~~~~~~~~~~~~~~~~~~
[Compile] mcp23017.c
make: *** [Makefile:85: wiringPi.o] Error 1