Question

In: Computer Science

What is the significance of -c , -g, -Wall and -o switches when we compile C/C++...

  1. What is the significance of -c , -g, -Wall and -o switches when we compile C/C++ code ?

Solutions

Expert Solution

Solution:

when you compile a c/c++ code the compiler takes care of all the intermediate steps like preprocessing , compilation and linking . But with some options you can stop the compilation at intermediate steps.

with the use of -c option you can stop the compilation process before the linking the process it says the compiler(gcc /g++) that do not run linker. That is when you use the -c option the output file produced will be of object code but not the executable code.

The -g option is used for debugging purposes. when you compile a source file with -g option the executable produced includes the source code into the executable and you can perform debugging with the help of GNU Debugger (gdb).

The -Wall option is used to enable all the warnings messages when compiling the program. That is it can warn you about unused variables, non void functions returns no values .. etc..

The -o option is used to create the executable with the given filename. this option is always used with a file name. If this option is not used when compiling the output executable will be created with the file name a.out by default.

I hope this would help...........


Related Solutions

When 43.7 g g of KClO3 K C l O 3 is completely decomposed, what is...
When 43.7 g g of KClO3 K C l O 3 is completely decomposed, what is the theoretical yield, in grams, of O2 ? Express your answer with the appropriate units. If 12.1 g of O2 is produced, what is the percent yield of O2 ? Express your answer with the appropriate units. Calculate the molar mass for Mn3O4 , an oxide of manganese. Express your answer to five significant figures. Calculate the number of moles of magnesium, chlorine, and...
when 1.6038 g of an organic iron compound Fe, C, H and O was burned in...
when 1.6038 g of an organic iron compound Fe, C, H and O was burned in O2, 2.9998 g of CO2 and 0.85850 g of H2O were produced. In a separate experiment to determine the mass percent of iron, 0.2726 g of the compound yielded 0.06159 g of Fe2O3. What is the empirical formula of the compound?
When a 0.860 g sample of an organic compound containing C, H, and O was burned...
When a 0.860 g sample of an organic compound containing C, H, and O was burned completely in oxygen, 1.64 g of CO2 and 1.01 g of H2O were produced. What is the empirical formula of the compound?
What was the political and moral significance of the Berlin Wall?
What was the political and moral significance of the Berlin Wall?
Explain the significance of the equation GDP = C + I + G + NX. What...
Explain the significance of the equation GDP = C + I + G + NX. What does it not include and why can that be an issue?
Conceptually, what are we doing when we test for statistical significance (such as in a z-test...
Conceptually, what are we doing when we test for statistical significance (such as in a z-test or t-test)? Where does the commonly used 95% confidence level come from? What is an effect size and what additional information does it provide about a finding?
Here is the equation 2 C 4 H 10 (g)+13 O 2 (g)→10 H 2 O(g)+8C...
Here is the equation 2 C 4 H 10 (g)+13 O 2 (g)→10 H 2 O(g)+8C O 2 (g) Calculate the mass of water produced when 1.20 g of butane reacts with excess oxygen. Calculate the mass of butane needed to produce 68.0 g of carbon dioxide.
compile and link two c programs from cmd prompt: using command gcc program1.c program2.h -o main...
compile and link two c programs from cmd prompt: using command gcc program1.c program2.h -o main but getting error undefined reference to scheduleFCFS not sure how to correct issue.
Describe the meaning and significance of business operations. What do we mean when we talk about...
Describe the meaning and significance of business operations. What do we mean when we talk about operations? What does it encompass? What does it exclude?
Consider the synthesis of CH2O:   CO(g)+H2(g)->CH2O(g).           At 25^o C, this reaction is accompanied by the change...
Consider the synthesis of CH2O:   CO(g)+H2(g)->CH2O(g).           At 25^o C, this reaction is accompanied by the change of  G^0=6.5 kcal/mol and H^0=-1.3 kcal/mol. You also know that:  CP of CH2O(g) =4.498+13.953x10^-3T - 3.730x10^-6 T^2 cal/deg mol.            CP of H2(g) = 6.9469-0.1999x10^-3 T +4.808x10^-7 T^2 cal/deg mol            CP of CO(g) =6.3424+1.8393x10^-3 T -2.801x10^-7 T^2 cal/deg mol        (a) Calculate the value of Kp at 1000K assuming delta H is independent of temperature.        (b) Calculate the value of Kp at 1000K taking into account the variation...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT