Last active
April 23, 2020 18:56
-
-
Save domiyanyue/d32b514e8dfef30a415828431199c8e0 to your computer and use it in GitHub Desktop.
Warning -Wunused-function example
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
int main(){ | |
int array[100]; | |
return array[1]; | |
} |
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
cpp_tutorial# g++ warning_example.cpp -Wuninitialized -o a | |
warning_example.cpp: In function ‘int main()’: | |
warning_example.cpp:4:19: warning: ‘array[1]’ is used uninitialized in this function [-Wuninitialized] | |
return array[1]; | |
^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment