This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/28378] Intrinsic extensions should be deselectable via command line



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]