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 compiler warning. #15

Merged
merged 1 commit into from
Nov 27, 2013
Merged

Fix compiler warning. #15

merged 1 commit into from
Nov 27, 2013

Conversation

shadone
Copy link
Contributor

@shadone shadone commented Nov 26, 2013

clang complains about the use of uninitialized variable in a case that should
never trigger (it is protected by an assert).

Warning: -Wsometimes-uninitialized in libnestegg/src/nestegg.c: variable 'r' is used uninitialized whenever switch case is taken
libnestegg/src/nestegg.c:968:8: warning: variable 'r' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TYPE_MASTER:
^~~~~~~~~~~
libnestegg/src/nestegg.c:974:7: note: uninitialized use occurs here
if (r == 1)
^
Warning: -Wsometimes-uninitialized in libnestegg/src/nestegg.c: variable 'r' is used uninitialized whenever switch case is taken
libnestegg/src/nestegg.c:969:8: warning: variable 'r' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
case TYPE_UNKNOWN:
^~~~~~~~~~~~
libnestegg/src/nestegg.c:974:7: note: uninitialized use occurs here
if (r == 1)
^
libnestegg/src/nestegg.c:937:8: note: initialize the variable 'r' to silence this warning
int r;
^
= 0

clang complains about the use of uninitialized variable in a case that should
never trigger (it is protected by an assert).

Warning: -Wsometimes-uninitialized in libnestegg/src/nestegg.c: variable 'r' is used uninitialized whenever switch case is taken
libnestegg/src/nestegg.c:968:8: warning: variable 'r' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
  case TYPE_MASTER:
       ^~~~~~~~~~~
libnestegg/src/nestegg.c:974:7: note: uninitialized use occurs here
  if (r == 1)
      ^
Warning: -Wsometimes-uninitialized in libnestegg/src/nestegg.c: variable 'r' is used uninitialized whenever switch case is taken
libnestegg/src/nestegg.c:969:8: warning: variable 'r' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
  case TYPE_UNKNOWN:
       ^~~~~~~~~~~~
libnestegg/src/nestegg.c:974:7: note: uninitialized use occurs here
  if (r == 1)
      ^
libnestegg/src/nestegg.c:937:8: note: initialize the variable 'r' to silence this warning
  int r;
       ^
        = 0
kinetiknz added a commit that referenced this pull request Nov 27, 2013
@kinetiknz kinetiknz merged commit f462231 into mozilla:master Nov 27, 2013
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.

2 participants