Skip to content

Unittest: Fix and forbid "control reaches end of non-void function" - #1356

Open
anordal wants to merge 1 commit into
FreeRTOS:mainfrom
anordal:unittest-fix-control-reaches-end-of-nonvoid-function
Open

Unittest: Fix and forbid "control reaches end of non-void function"#1356
anordal wants to merge 1 commit into
FreeRTOS:mainfrom
anordal:unittest-fix-control-reaches-end-of-nonvoid-function

Conversation

@anordal

@anordal anordal commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This commit fixes or removes all non-void functions that did not return a value. I don't know why Ubsan hasn't catched these yet.

Indeed, most of them were unused. All of them were stubs. Another warning down, and with it 500 LOC.

There were only two places I had to choose between returning success or failure: Only in the FreeRTOS_Sockets unittest did it matter to the outcome of the test. In the other, in FreeRTOS_RA, the caller ignored the return value.

Checklist:

  • I have tested my changes, as in running the unittests. They only affect stubs and build files used in unittests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request: No functional changes.

Related Issue

This is a continuation of #1228 (fix and forbid specific warnings).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This is a continuation of FreeRTOS#1228 (fix and forbid specific warnings).

This commit fixes or removes all non-void functions that did not
return a value. I don't know why Ubsan hasn't catched these yet.

Indeed, most of them were unused. All of them were stubs.
Another warning down, and with it 500 LOC.

There were only two places I had to choose between returning
success or failure: Only in the FreeRTOS_Sockets unittest
did it matter to the outcome of the test. In the other,
in FreeRTOS_RA, the caller ignored the return value.
@anordal
anordal force-pushed the unittest-fix-control-reaches-end-of-nonvoid-function branch from 904dd41 to c137ea2 Compare July 11, 2026 08:53
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.

1 participant