Skip to content

Conversation

@avsej
Copy link

@avsej avsej commented Jun 29, 2018

Because there weren't obvious intention to fall through the switch statement when no options matched, I used the following default branch to instruct compiler that those values won't be used uninitialized.

default:
    zig_unreachable();

Verified

This commit was signed with the committer’s verified signature.
avsej Sergey Avseyev
@isaachier
Copy link
Contributor

I tend to agree with you on this sort of thing, but @andrewrk isn't of the same opinion. See f0e77c1#commitcomment-28918334.

@andrewrk
Copy link
Member

I have it the other way intentionally, for 2 reasons:

  • I want compile errors when new enum values are introduced.
  • I want valgrind to notice when use of undefined value occurs.

@andrewrk andrewrk closed this Jun 29, 2018
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.

None yet

3 participants