Ticket #542 (Fixed)Sun Jan 30 16:00:57 UTC 2022
cc 5.88: The compiler thinks noreturn functions can return
Reported by: | Jeffrey Lee (213) | Severity: | Normal |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by Jeffrey Lee (213):
If a call to a noreturn function is made from a function which has a return value, the compiler can generate an “implicit return in non-void function” warning, even for trivial cases where the only thing in the function body is a call to a noreturn function.
Additionally, it looks like any code placed after a call to a noreturn function doesn’t get stripped out by the compiler, resulting in unnecessary bloat. E.g. when compiling the attached test code, the “unreachable” message is clearly visible in the compiled binary. However in most cases this bloat will probably only be a few extra instructions, so I’d say this is less serious than the incorrect warnings.
Changelog:
Modified by Jeffrey Lee (213) Sun, January 30 2022 - 16:01:29 GMT
- Attachment added: test
Simple C example
Modified by Jeffrey Lee (213) Sat, September 24 2022 - 11:27:13 GMT
- Status changed from Open to Fixed
Appears to be fixed with CC 5.90 (DDE 31a)