Hello, everyone, crossing, last time we were talking about GCC compilation-related content. This time let's talk about how to use GCC to issue a warning, free
The words go forward, and the words return to the positive. Let's talk about GCC together!
Crossing, GCC has the ability to compile warnings. What is a compile warning? There are crossing questions under the table. The so-called compile warning is that the compiler
Some content that does not conform to the compilation rules but conforms to the compiler syntax is given a warning during the translation process. I'm using a real-life example to give you
Make a metaphor: everyone has seen the football game, the referee in the football match holding a yellow and red color cards. Players in the game
Violations of the rules of the game often occur, if the player violates the rules will not bring serious consequences for the game, then the referee will show the players
Yellow. If a player violates a rule that will have serious consequences for the game, the referee will show the player a red card. The yellow card in the football match is good.
A red card is a compilation error in GCC than a compilation warning in GCC. GCC issues a compilation warning, but it can continue compiling. GCC issued
Compile error, then it will stop compiling.
By default, GCC turns on the compile warning feature, but only contains some basic warning information that we can use with GCC options
Let GCC emit more and more compilation warnings during the compilation process.
The option WalL allows GCC to issue more warnings. Example: Gcc-wall file.c-o F.O
option Werror allows GCC to treat warnings as errors, and option wall will allow GCC to issue more warnings, but won't let GCC stop
Compile. Option Werror will cause GCC to stop compiling when a warning occurs.
Crossing, warning messages, also useful information, because there may be some potential errors in the warning. So when using GCC, try to open the police
Warning messages generated at compile time, and modify them until no compile warning is generated.
Crossing, here's what we're going to say about GCC today. Want to know how to funeral, and listen to tell!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Talk to GCC (fourth: GCC warning)