Fortran运行时警告:扩展名:$descriptor

Fortran运行时警告:扩展名:$descriptor,fortran,gfortran,Fortran,Gfortran,我使用的是第三方提供的非常旧的Fortran 77代码(也有很多错误)。我已用 FFLAGS=-O0 -Wall -g -fbacktrace -pedantic -Wextra 我在运行时收到标题中的警告: At line <number> of file <namefile>.f (unit=6, file='stdout') Fortran runtime warning: Extension: $ descriptor 在文件.f的第行(单位=6,文件='st

我使用的是第三方提供的非常旧的Fortran 77代码(也有很多错误)。我已用

FFLAGS=-O0 -Wall -g -fbacktrace -pedantic -Wextra
我在运行时收到标题中的警告:

At line <number> of file <namefile>.f (unit=6, file='stdout')
Fortran runtime warning: Extension: $ descriptor
在文件.f的第行(单位=6,文件='stdout')
Fortran运行时警告:扩展名:$descriptor

我想知道这意味着什么。

您应该始终在错误或警告消息中显示代码行号,代码行号指向该行

$
在中的角色

write(*,'(a$)') "string"
是为了避免在屏幕上打印“字符串”后转到下一行

但是,描述符是非标准的,因此编译器会警告您这一点

标准方法是使用非推进输入/输出:

write(*,'(a)', advance="no") "string"

旧的Fortran代码很可能会发出许多警告,尤其是使用
-Wextra
-pedantic
。它们很可能包含a)非标准扩展,b)现在已经过时甚至被删除的功能。我认为这些选项对于旧代码不是很有用。