Created
February 23, 2014 17:34
-
-
Save adamf/9174495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awf-macbookair1:t awf$ cat foo.c | |
#include <stdio.h> | |
int main() { | |
if(1) | |
goto foo; | |
goto foo; | |
printf("here\n"); | |
foo: | |
return 1; | |
} | |
awf-macbookair1:t awf$ clang -Wall -Werror foo.c | |
awf-macbookair1:t awf$ ls a.out | |
a.out | |
awf-macbookair1:t awf$ rm a.out | |
awf-macbookair1:t awf$ clang -Weverything -Werror foo.c | |
foo.c:9:4: error: will never be executed [-Werror,-Wunreachable-code] | |
printf("here\n"); | |
^~~~~~ | |
foo.c:7:6: error: will never be executed [-Werror,-Wunreachable-code] | |
goto foo; | |
^~~~~~~~ | |
2 errors generated. | |
awf-macbookair1:t awf$ ls a.out | |
ls: a.out: No such file or directory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment