This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28378] Intrinsic extensions should be deselectable via command line
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 May 2008 18:11:44 -0000
- Subject: [Bug fortran/28378] Intrinsic extensions should be deselectable via command line
- References: <bug-28378-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from kargl at gcc dot gnu dot org 2008-05-13 18:11 -------
(In reply to comment #3)
> This is an important to fix. I just ran into problems from this. Gfortran is
> supposed to aim for standards conformance, but vendor extensions are not
> supposed to break valid code. I think this behavior is a Standards violation,
> and really should be a BUG and not just an enhancement.
You conveniently forgot to include your standing conforming code.
Also, note the standard does not prohibit a vendor for add intrinsic
subprograms to its runtime library that are not explicitly listed
in the standard.
> This is mainly a problem with intrinsic subroutines, because non-intrinsic
> functions require an EXTERNAL declaration, and automatically override
> intrinsic
> functions. This is also the main reason the INTRINSIC declaration exists.
> Without it, Gfortran should assume that it is an external subroutine, not an
> intrinsic. Some F77 compilers make the selection automatic by letting the
> linker find the user's subroutine first, and then link to one in a Fortran
> extension library if not found.
>
There is an option.
troutmask:kargl[208] gfc -o z a.f90
troutmask:kargl[209] ./z
0
troutmask:kargl[210] gfc -o z -std=f95 a.f90
troutmask:kargl[211] ./z
42
troutmask:kargl[212] cat a.f90
program a
integer i
i = iargc()
print *, i
end program a
function iargc()
integer iargc
iargc = 42
end function iargc
And for the record,
troutmask:kargl[213] gfc -o z -std=f95 -fall-intrinsics a.f90
troutmask:kargl[214] ./z
0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28378