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

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

7Ji
Copy link

@7Ji 7Ji commented Jul 26, 2024

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

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
```
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

Successfully merging this pull request may close these issues.

2 participants