GNU Fortran Compiler Options Quiz
53 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the -Wintrinsic-shadow option do?

  • Warns if a procedure has the same name as an intrinsic. (correct)
  • Provides hints for optimizing intrinsic procedures.
  • Automatically renames user-defined procedures.
  • Suppresses warnings about intrinsic procedures.
  • What are the implications of using the -Wunused-parameter option in gfortran?

  • It is included in the -Wall option.
  • It ignores all parameter warnings.
  • It warns about unused PARAMETER values. (correct)
  • It warns about unused dummy arguments.
  • What does the -Werror option accomplish?

  • It turns all warnings into errors. (correct)
  • It suppresses all warnings during compilation.
  • It converts errors into warnings.
  • It treats all warnings as non-critical.
  • What is the primary use of the -fdump-parse-tree option?

    <p>To debug the internal working of the gfortran compiler.</p> Signup and view all the answers

    Which IEEE exceptions can be specified with the -ffpe-trap option?

    <p>Invalid, zero, overflow, underflow, precision, and denormal.</p> Signup and view all the answers

    What happens when the -Walign-commons option is activated?

    <p>It warns about variable padding for alignment in COMMON blocks.</p> Signup and view all the answers

    Which option is used to suppress the warnings generated by -Walign-commons?

    <p>-Wno-align-commons</p> Signup and view all the answers

    What does the parameter 'list' in the -ffpe-trap option represent?

    <p>A list of specific IEEE exceptions to raise for FPE.</p> Signup and view all the answers

    Which version of the Fortran standard is NOT fully supported by the GNU Fortran compiler?

    <p>Fortran 2008</p> Signup and view all the answers

    What is the primary purpose of the gfortran command?

    <p>To invoke the GNU Fortran compiler</p> Signup and view all the answers

    What happens after the compilation of a Fortran program using gfortran?

    <p>The source code is translated into machine code</p> Signup and view all the answers

    Which of the following best describes the errors the Fortran 90 standard requires the compiler to report?

    <p>Flaws in source code that prevent binary creation</p> Signup and view all the answers

    What is a key benefit of using high-level programming languages like Fortran over machine code?

    <p>They are faster to write</p> Signup and view all the answers

    Which of the following statements is true regarding the GNU Fortran compiler's support for language standards?

    <p>It completely supports Fortran 77, 90, and 95 standards.</p> Signup and view all the answers

    In what case will the GNU Fortran compiler provide error messages to users?

    <p>When the source code is flawed</p> Signup and view all the answers

    Which of the following is NOT a goal of the GNU Fortran compiler?

    <p>Providing a debugging environment for users</p> Signup and view all the answers

    What does the option '-fopenmp' enable in a Fortran program?

    <p>OpenMP directives and runtime library linking</p> Signup and view all the answers

    What is the consequence of using '-fno-range-check' in a Fortran compilation?

    <p>Expressions outside the range will be assigned +Inf or -Inf</p> Signup and view all the answers

    Which of the following standards does the option '-std=legacy' refer to?

    <p>Old non-standard programs without warnings</p> Signup and view all the answers

    Which option specifies that preprocessing should be enabled in Fortran?

    <p>-cpp</p> Signup and view all the answers

    What is the default standard value for Fortran when no standard is specified?

    <p>gnu</p> Signup and view all the answers

    What does the option '-std=f2003' enforce during compilation?

    <p>Strict conformance to Fortran 2003 standards</p> Signup and view all the answers

    What will occur if an integer overflow is detected with '-fno-range-check' option?

    <p>The value will wrap around to -1</p> Signup and view all the answers

    When enabling OpenMP with '-fopenmp', which feature is also implicitly enabled?

    <p>Recursive function support</p> Signup and view all the answers

    What is the impact of using the option '-fmax-stack-var-size=n'?

    <p>It affects the size of the largest array placed on the stack.</p> Signup and view all the answers

    Which option should be used to allow recursive procedures without the RECURSIVE attribute?

    <p>-frecursive</p> Signup and view all the answers

    What does the '-fpack-derived' option do?

    <p>It packs derived type members closely together.</p> Signup and view all the answers

    How does the '-frepack-arrays' option affect array handling?

    <p>It ensures data is passed contiguously for better performance.</p> Signup and view all the answers

    What is the consequence of using the '-fshort-enums' option?

    <p>It allows all enumerators to fit into the smallest INTEGER kind.</p> Signup and view all the answers

    What is a potential downside of using the '-fpack-derived' option?

    <p>It could lead to incompatibilities with other compiled code.</p> Signup and view all the answers

    What is the default value for the '-fmax-stack-var-size' option?

    <p>32768</p> Signup and view all the answers

    What happens when the size of an array exceeds the limit set by '-fmax-stack-var-size'?

    <p>Static memory will be used instead of stack memory.</p> Signup and view all the answers

    What type of function is BESSEL_J1?

    <p>Bessel function of the first kind of order 1</p> Signup and view all the answers

    Which function is used to test for NaN (Not a Number) values?

    <p>ISNAN</p> Signup and view all the answers

    The CEILING function is used to:

    <p>Round up to the nearest integer</p> Signup and view all the answers

    Which intrinsic function would you use to get the current time as a string?

    <p>CTIME</p> Signup and view all the answers

    Which function provides the bit size inquiry for a variable?

    <p>BIT_SIZE</p> Signup and view all the answers

    What does the MOD function do?

    <p>Returns the remainder of a division</p> Signup and view all the answers

    To convert a double precision real number to a default real number, which function would you use?

    <p>SNGL</p> Signup and view all the answers

    Which function would you use to remove trailing blank characters from a string?

    <p>TRIM</p> Signup and view all the answers

    What is the purpose of the EXIT function?

    <p>To terminate a program or process</p> Signup and view all the answers

    Which function calculates the Euclidean distance between two points?

    <p>HYPOT</p> Signup and view all the answers

    Which function can be used to initialize a pseudo-random number sequence?

    <p>RANDOM_SEED</p> Signup and view all the answers

    What does the LEN_TRIM function return?

    <p>The length excluding trailing blanks</p> Signup and view all the answers

    Which of the following functions converts an integer to a default real type?

    <p>FLOAT</p> Signup and view all the answers

    Which of the following file extensions will GNU Fortran recognize for compiling Fortran source code?

    <p>.f90</p> Signup and view all the answers

    What is the purpose of the GCC middle end in the compilation process?

    <p>Optimizes code</p> Signup and view all the answers

    What is the role of the 'gfortran' driver program within the GCC?

    <p>It automatically links Fortran runtime libraries</p> Signup and view all the answers

    Which statement about preprocessing and conditional compilation in GNU Fortran is correct?

    <p>The GNU C Preprocessor is commonly used for preprocessing.</p> Signup and view all the answers

    How does GCC determine whether to treat a source file as fixed form or free form?

    <p>By the file extension</p> Signup and view all the answers

    What is the primary document that provides a complete reference for the GNU Fortran compiler?

    <p>GNU Fortran and GCC Manual</p> Signup and view all the answers

    Which command does the gcc driver program primarily use to compile Fortran source files?

    <p>f951</p> Signup and view all the answers

    What characteristic do the capitalized file extensions have when processed by the GNU Fortran compiler?

    <p>They undergo preprocessing.</p> Signup and view all the answers

    Study Notes

    GNU Fortran Compiler

    • GNU Fortran is a Fortran compiler, part of the GCC compiler suite.
    • It supports Fortran 77, 90, 95, parts of 2003 and 2008 standards.
    • It also supports some vendor extensions.

    GNU Fortran Documentation

    • Published by the Free Software Foundation
    • Licensed under the GNU Free Documentation License.
    • The manual covers invoking GNU Fortran, its command options, runtime, language reference, extensions, mixed-language programming, intrinsic procedures, modules, and contributing sections.

    Table of Contents

    • The table of contents details sections within the manual, including specific topics like introduction, command options, runtime, language reference, extensions, etc.
    • The table is organized by Parts and sections.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    GNU Fortran PDF

    Description

    Test your knowledge about various options available in the GNU Fortran compiler. This quiz covers options like -Wintrinsic-shadow, -Wunused-parameter, and more, helping you understand their implications and uses. Perfect for students and developers looking to deepen their understanding of Fortran compiler behavior.

    Use Quizgecko on...
    Browser
    Browser