Slide 63 of 97
Notes:
We will be using some common compiler options in this code which are commonly used in a variety of situations.
The option minus g enables source-level symbolic debugging of our C code, which allows us to say "go main" and have the debugger know where main is and what it is.
Minus s, allows us to interlist C statements into the assembly listing. This allows us to see an intertwined relationship between lines of C and lines of assembly when we're debugging C code with assembly. In this case, we will see a line of C highlighted along with several lines of corresponding assembly. That's also useful when we want to debug C code.
Minus o2 invokes the compiler optimizer at the second highest level. Minus o3 is the highest level but minus o3 does file optimizations. This would be used if we had several files and wanted to compile them with the highest level of optimization. In our example, we have only one file.
Minus k keeps an assembly language file. In this segment we will examine the output of the compiler, which is an assembly language file. If we didn't use the minus k, it would automatically just call up the assembler and create an obj file. But since we want to see what type of code the compiler is generating, we will use the minus k option.