110k views
3 votes
Which of the following flags are required for compilation in this course? Select all that apply:

a. -std=c99
b. -Wall
c. -pedantic
d. -ansi
e. -w
f. -std=c89

User Truefalse
by
8.2k points

1 Answer

2 votes

Final answer:

In C programming, flags like -std=c99, -Wall, and -pedantic are often required for strict adherence to C standards and receiving helpful compiler warnings. The -ansi flag is equivalent to -std=c89, both refer to the ANSI C standard.

Step-by-step explanation:

The flags mentioned are used in C programming to control the compilation process. Flags -std=c99 and -std=c89 specify the version of the C standard to which the code should conform. Flag -Wall enables all the compiler's warning messages which is useful for catching potential errors. The flag -pedantic is used to ensure strict ISO compliance, rejecting any code that isn't strictly standard C. The flag -ansi is synonymous with -std=c89, which both enforce the ANSI C standard, also known as C90. Lastly, the flag -w suppresses all warnings, which is generally not recommended, as warnings can indicate potential issues with the code.

User Messerbill
by
8.6k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.