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 Issue 16176 - Unreachable code not detected with -w #5868

Closed
wants to merge 1 commit into from

Conversation

WalterBright
Copy link
Member

No description provided.

@dlang-bot
Copy link
Contributor

dlang-bot commented Jun 15, 2016

Fix Bugzilla Description
16176 Unreachable code not detected with -w

@WalterBright WalterBright force-pushed the fix16176 branch 2 times, most recently from a19fa3b to caea967 Compare June 15, 2016 10:29
@WalterBright
Copy link
Member Author

That fails miserably because of code like this:

private size_t _clockTypeIdx(ClockType clockType)
{
    final switch(clockType)
    {
        foreach(i, name; __traits(allMembers, ClockType))
        {
        case __traits(getMember, ClockType, name):
            return i;
        }
    }
    assert(0);
}

I may have to give up on this.

@andralex
Copy link
Member

Auto-merge toggled on

@WalterBright
Copy link
Member Author

I'm going to abandon this for now. It needs much more careful work, given the weird Duff-like uses that I do not want to break. Besides, I already have another PR to pick up the skipped initializations reliably, so this becomes unimportant.

@JackStouffer
Copy link
Member

@WalterBright Are you aware of people asking for you to get rid of this error entirely?

@mathias-lang-sociomantic
Copy link
Contributor

Not entirely. It has some value (Apple's goto fail bug is often mentioned obviously). However, it would be greatly appreciated if it was not issued in the situation mentioned in the P.R. (when it makes templated code harder to write, basically). Also, and even more important, it's a blocker for VRP improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants