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

Compiler Warnings About Unreachable Code #32

Open
drewr95 opened this issue Mar 13, 2022 · 1 comment
Open

Compiler Warnings About Unreachable Code #32

drewr95 opened this issue Mar 13, 2022 · 1 comment

Comments

@drewr95
Copy link
Contributor

drewr95 commented Mar 13, 2022

Building with Tasking Tricore v6.3r1 compiler, with C++14 as the standard, I get the following warnings:

cptc W0111: ["path/to/st_tree/include/st_tree_nodes.h" 130] statement is unreachable
cptc W0111: ["path/to/st_tree/include/st_tree_nodes.h" 723] statement is unreachable

Culprits:

return false;

return r.first;

I may have a possible solution for line 130, but I don't understand the one at line 723. Any ideas?

@erikerlandson
Copy link
Owner

IIRC, both were to satisfy some version of the compiler that wanted a return value. It was 10 years ago 😀

Line 723 is probably because there is a throw right above that will always execute. Line 130 is because it's after a while(true), so it will never reach 130.

st_tree used to be backward compatible to c++98, however it now assumes >= c++11, so possibly these are no longer an issue. Maybe the warnings can be avoided with a pragma?

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

No branches or pull requests

2 participants