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

Needs to remove run-time check which is always false #2035

Open
SergeyKopienko opened this issue Feb 3, 2025 · 3 comments
Open

Needs to remove run-time check which is always false #2035

SergeyKopienko opened this issue Feb 3, 2025 · 3 comments
Assignees

Comments

@SergeyKopienko
Copy link
Contributor

SergeyKopienko commented Feb 3, 2025

Probably better replace to

#if 0
    // code
#else
    // code
#endif
@akukanov
Copy link
Contributor

akukanov commented Feb 3, 2025

Tagging @danhoeflinger

I think #if 0 is not really better that the "runtime" check; it's still dead code. In some sense it's even worse, because now this code should at least compile without errors.

In principle, any "branching" is only needed if we expect the two code variants to coexist for some time in the future. In that case there should be a better condition check instead of "true/false", at least a named variable/macro.

If we do not expect the need to have two variants of the code and want to avoid dead code, I would just use comments.

@danhoeflinger
Copy link
Contributor

Perhaps @adamfidel is the better person to tag here. I'm happy to make some changes here to improve this, but I didn't write this code.

@adamfidel
Copy link
Contributor

I agree that commenting out the if (0) branch would be an acceptable alternative to what is there currently.

@adamfidel adamfidel self-assigned this Feb 3, 2025
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

4 participants