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 -Werror=maybe-uninitialized errors #1172

Closed
wants to merge 1 commit into from
Closed

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();

@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