GCC 4.9.0 发布,提升 C++11 和 C++14 特性

2020-11-26 09:53

阅读:692

  • Compatibility notice:

    • Note that the argument passing ABI has changed for scalar dummy    arguments of typeINTEGERREAL,  COMPLEX and LOGICAL, which have  both the VALUE and theOPTIONAL  attribute.

    • Due to the support of finalization, the virtual table associated          with polymorphic variables has changed. Therefore, code containing          CLASS should be recompiled, including all files which          define derived types involved in the type definition used by          polymorphic variables. (Note: Due to the incremented module version,          trying to mix old code with new code will usually give an error          message.)

    • Module files: The version of the module files (.mod)        has been incremented; additionally, module files are now compressed.        Fortran MODULEs compiled by earlier GCC versions have        to be recompiled, when they are USEd by files compiled        with GCC 4.9, because GCC 4.9 is not able to read .mod        files of earlier GCC versions; attempting to do so gives an error        message. Note: The ABI of the produced assembler data itself has not        changed: object files and libraries are fully compatible to older        versions. (Except for the next items.)

    • ABI changes:

    • GNU Fortran no longer deallocates allocatable variables or        allocatable components of variables declared in the main program. Since        Fortran 2008, the standard explicitly states that variables declared        in the Fortran main program automatically have theSAVE        attribute.

    • When opening files, the close-on-exec flag is set if the system        supports such a feature. This is generally considered good practice        these days, but if there is a need to pass file descriptors to child        processes the parent process must now remember to clear the        close-on-exec flag by calling fcntl(), e.g. via        ISO_C_BINDING, before executing the child process.

  • The deprecated command-line option -fno-whole-file      has been removed. (-fwhole-file is the default since      GCC 4.6.) -fwhole-file/-fno-whole-file      continue to be accepted but do not influence the code generation.

  • The compiler no longer unconditionally warns      about DO loops with zero iterations.  This warning is now      controlled by the -Wzerotrips option, which is implied by      -Wall.

  • The new NO_ARG_CHECK attribute of the !GCC$ directive can be used to disable the      type-kind-rank (TKR) argument check for a dummy argument. The feature      is similar to ISO/IEC TS 29133:2012‘s TYPE(*), except that      it additionally also disables the rank check. Variables with      NO_ARG_CHECK have to be dummy arguments and may only be      used as argument to ISO_C_BINDING‘s C_LOC      and as actual argument to another NO_ARG_CHECKdummy      argument; also the other constraints of TYPE(*) apply.      The dummy arguments should be declared as scalar or assumed-size      variable of type type(*) (recommended) – or of      type integerrealcomplex      or logical. With NO_ARG_CHECK, a pointer      to the data without further type or shape information is passed,      similar to C‘s void*. Note that also TS 29113‘s      type(*),dimension(..) accepts arguments of any type and      rank; contrary to NO_ARG_CHECK assumed-rank arguments      pass an array descriptor which contains the array shape and stride      of the argument.

  • Fortran 2003:

    • Finalization is now supported. Note that finalization is currently        only done for a subset of the situations in which it should occur.

    • Experimental support for scalar character components with        deferred length (i.e. allocatable string length) in derived types has        been added. (Deferred-length character variables are supported since        GCC 4.6.)

  • Fortran 2008:

    • When STOP or ERROR STOP is used to terminate        the execution and any exception (but inexact) is signaling, a warning is        printed to ERROR_UNIT, indicating which exceptions are        signaling. The -ffpe-summary= command-line option can be used to fine-tune        for which exception the warning should be shown.

    • Rounding on input (READ) is now handled on systems where        strtod honours the rounding mode. (For output, rounding is        supported since GCC 4.5.) Note that for input, the        compatible rounding mode is handled as nearest        (i.e., for a tie, rounding to an even last significant        [cf. IEC 60559:1989] – while compatible rounds away        from zero for a tie).


评论


亲,登录后才可以留言!