SHARED option in OPEN Statement in the Fortran standard

前端 未结 1 512
庸人自扰
庸人自扰 2021-01-24 04:22

In this documentation HP Fortran doc, the OPEN statement accept SHARED and READONLY options.
In this documentation Standard Fortran 2008 doc, the OPEN statement dosn\'t acce

1条回答
  •  盖世英雄少女心
    2021-01-24 05:00

    Those IO extensions (SHARED, READONLY, etc) as well as other extensions, as would be available with DEC based Fortran should be available in GCC/gFortran via the "-fdec" and related compiler switches.

    However, I found some confusion in the online GCC docs. Apparently, some older versions of gFortran (and in particular g77) may require the compiler to have been built with the libf2c element, and there may be differences on Unix (c.f. Win etc).

    It is not clear exactly which versions of gFortran accept this. For example, under Windows, with GCC/gFortran 6.x, it would not recognise the "-fdec" switch.

    Apparently, GCC/gFortran v7.x have all that working, but v7 is still in "development mode" ... are you feeling lucky :-) ?

    Also, some references give dire warnings about reliance on "extensions".

    Here are some pages of interest:

    https://gcc.gnu.org/wiki/GFortran/News

    https://gcc.gnu.org/onlinedocs/gfortran/Extended-I_002fO-specifiers.html

    https://gcc.gnu.org/onlinedocs/gfortran/Option-Summary.html

    https://gcc.gnu.org/onlinedocs/gfortran/Fortran-Dialect-Options.html

    The last link seems particularly "dire" on the subject.

    0 讨论(0)
提交回复
热议问题