GCC 4.9.0 发布,提升 C++11 和 C++14 特性
2020-11-26 09:53
-
Compatibility notice:
-
Note that the argument passing ABI has changed for scalar dummy arguments of type
INTEGER
,REAL
,COMPLEX
andLOGICAL
, which have both theVALUE
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. FortranMODULE
s compiled by earlier GCC versions have to be recompiled, when they areUSE
d 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 the
SAVE
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. viaISO_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‘sTYPE(*)
, except that it additionally also disables the rank check. Variables withNO_ARG_CHECK
have to be dummy arguments and may only be used as argument toISO_C_BINDING
‘sC_LOC
and as actual argument to anotherNO_ARG_CHECK
dummy argument; also the other constraints ofTYPE(*)
apply. The dummy arguments should be declared as scalar or assumed-size variable of typetype(*)
(recommended) – or of typeinteger
,real
,complex
orlogical
. WithNO_ARG_CHECK
, a pointer to the data without further type or shape information is passed, similar to C‘svoid*
. Note that also TS 29113‘stype(*),dimension(..)
accepts arguments of any type and rank; contrary toNO_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
orERROR STOP
is used to terminate the execution and any exception (but inexact) is signaling, a warning is printed toERROR_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 wherestrtod
honours the rounding mode. (For output, rounding is supported since GCC 4.5.) Note that for input, thecompatible
rounding mode is handled asnearest
(i.e., for a tie, rounding to an even last significant [cf. IEC 60559:1989] – whilecompatible
rounds away from zero for a tie).
-
上一篇:PHP (20140430)
下一篇:Json帮助类以及如何使用
文章标题:GCC 4.9.0 发布,提升 C++11 和 C++14 特性
文章链接:http://soscw.com/index.php/essay/22625.html