250+ TOP MCQs on Various Options and Answers

Linux / Unix questions and answers focuses on various options used in compilation with gcc. This is set 1.1. The command “cpp .c > .i” will
a) create the expanded source code file sanfoudry.i for the source code file .c
b) append the content of the .c into .i
c) give an error
d) none of the mentioned

Answer: a
Clarification: None.

2. Which option of gcc makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes?
a) -p
b) -P
c) -q
d) -Q

Answer: d
Clarification: None.

3. The -Wextra option of gcc
a) is same as -w option
b) does not exist
c) enables extra warning messages
d) none of the mentioned

Answer: c
Clarification: None.

4. Which gcc option undefines a preprocessor macro?
a) -U
b) -u
c) -undefine
d) none of the mentioned

Answer: a
Clarification: None.

5. Pipes are used rather than temporary files for communication between the various stages of compilation in gcc when
a) -pipe option is used
b) -temp option is used
c) –disable -temp option is used
d) none of the mentioned

Answer: a
Clarification: None.

6. The gcc option -Wunused warns when a _____ variable is unused aside from its declaration.
a) variable
b) function
c) macro
d) none of the mentioned

Answer: a
Clarification: None.

7. Which one of the following is not true?
a) source codes can not be compiled with static libraries in gcc
b) -O is used for optimization in gcc
c) source codes can be compiled
d) none of the mentioned

  250+ TOP MCQs on Shell Redirection and Answers

Answer: a
Clarification: None.

8. The command line options of gcc can also be read from a file with
a) @
b) $
c) #
d) none of the mentioned

Answer: c
Clarification: None.

9. Which option of the gcc is used to warn is padding is included in structure?
a) -Wpadded
b) -Wpad
c) -Wpadding
d) None of the mentioned

Answer: a
Clarification: None.

10. Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?
a) -time
b) -cpu
c) -process
d) none of the mentioned

Answer: a

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top