What does GFC_STD_F77 do?
Steve Kargl
sgk@troutmask.apl.washington.edu
Mon Jan 31 06:24:00 GMT 2005
On Sat, Jan 29, 2005 at 08:55:47PM +0200, Janne Blomqvist wrote:
> On Wed, Jan 26, 2005 at 06:18:56PM -0800, Steve Kargl wrote:
> > troutmask:sgk[203] gfc -o d -std=f95 d.f
> > In file d.f:7
> >
> > z8 = cos(z8)
> > 1
> > Error: Type of argument 'x' in call to 'cos' at (1) should be REAL(4),
> > not COMPLEX(8)
> > troutmask:sgk[204] gfc -o d -std=gnu d.f
> >
> > This is clearly not good.
>
> Hmm, whether that is a real bug or only a case of being overly anal
> can be debated. ;-) AFAIK, F95 does not define sqrt for complex
> arguments (it's a G77 extension), so technically it's correct to
> abort. Whether it's practical and reasonable is another question.
Ah, no, sqrt is defined for complex arguments. See 13.7.115.
> One possible solution could be to create a command-line option
> -freally-strict-std or something like that, and do the above thing
> only if that flag is used? This could be implemented e.g. by including
> a check for that option in the make_generic function that is used to
> add a set of intrinsics under a single generic name.
>
> Well, as I proposed the fix described above, I guess I'm obliged to
> volunteer to do it. Unless Steve or somebody else has a better idea?
This doesn't work at the make_generic level. I know I tried
changing the error to a warning. add_function, which has calls
to make_generic, is used to construct a table of intrinsic
procedure names. This occurs before the parser ever hits a
nonstandard intrinsic procedure. I think we would want the
warning to be issued only if the source code included the
nonstandard intrinsic.
--
Steve
More information about the Fortran
mailing list