On Monday, January 15, 2018 at 12:51:31 PM UTC-5, Steve Lionel wrote:
> ..
> The last thing we need is yet ANOTHER file type that some compilers
> support and some don't. ..
> .. I do, sort of, like the idea of a marker in a source file ..
> most compilers support this in various implementation-dependent ways.
Well, a file extension is NOT a type. See an example of perceived file types on Windows:
https://msdn.microsoft.com/en-us/library/windows/desktop/cc144150(v=vs.85).aspx
If a coder is piping a source file that is in TEXT file format to a processor and is WILLING to provide a compiler option (e.g., -ffree-form) or a marker, then the file extension should NOT matter. Yet, a couple of compilers issue errors which is not "doing right by" the coders:
https://en.wiktionary.org/wiki/do_right_by
gfortran:
--- begin console output ---
C:\temp>type p.f
print *, "Hello World!"
end
C:\temp>gfortran -ffree-form p.f -o p.exe
C:\temp>p.exe
Hello World!
C:\temp>type p.mf
print *, "Hello World!"
end
C:\temp>gfortran -ffree-form p.mf -o p.exe
c:/program files/codeblocks/gfortran/bin/../lib/gcc/x86_64-w64-mingw32/8.0.0/../
../../../x86_64-w64-mingw32/bin/ld.exe:p.mf: file format not recognized; treatin
g as linker script
c:/program files/codeblocks/gfortran/bin/../lib/gcc/x86_64-w64-mingw32/8.0.0/../
../../../x86_64-w64-mingw32/bin/ld.exe:p.mf:1: syntax error
collect2.exe: error: ld returned 1 exit status
--- end console output ---
Intel Fortran:
--- begin console output ---
C:\temp>type p.f
print *, "Hello World!"
end
C:\temp>ifort /free p.f
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R
) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.12.25831.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:p.exe
-subsystem:console
p.obj
C:\temp>p.exe
Hello World!
C:\temp>type p.mf
print *, "Hello World!"
end
C:\temp>ifort /free p.mf
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R
) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
ifort: command line warning #10161: unrecognized source type 'p.mf'; object file
assumed
ipo: warning #11010: file format not recognized for C:\temp\p.mf
Microsoft (R) Incremental Linker Version 14.12.25831.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:p.exe
-subsystem:console
p.mf
p.mf : fatal error LNK1107: invalid or corrupt file: cannot read at 0x21
--- end console output ---