Re: two complaints by Intel Fortran



highegg <highegg@xxxxxxxxx> wrote:

when porting a gfortran-developed program to Intel today, I stumbled
across two issues:
1. Intel (9.1.040 for AMD/Linux) consider two interfaces incompatible
if one has an overriden lower bound for array.
....
g95, gfortran and pathscale accept it. I suppose Intel is wrong,
according to 12.2.1.1 of F2003. Or was this different in F95?

Sounds like a compiler bug to me. The shape is a characteristic; the
bounds aren't. No change in this area since f90 that I can think of.

2. this happened when compiling an automatically generated source.
Intel (as well as g95, gfortran and pathscale) accepts an empty
generic interface, but unlike
the others it refuses to swallow a PUBLIC spec for it. Source:
module testm
implicit none
interface empty
! nothing here
end interface

public empty ! ERROR

end module

is rejected by Intel. I admit this _really_ is a corner case. I can't
figure this out from the standard.

The code looks fine to me. Another compiler bug. There are some syntax
forms that the standard doesn't allow to be empty. Mostly such
restrictions are pointless and prohibit perfectly sensible and useful
code. A few such restrictions have been removed in later versions of the
standard.

For example, there still seems to be a restriction against having a
CONTAINS with nothing after it; don't ask me why. (I though that one
went away with f2003, but it looks to still be there). That can be
useful for simplifying automatic code generation (or comparable rote
things done by hand).

Another example is a derived type with no components. That turns out to
be quite useful, common even, for inheritance, so I'm sure that one got
fixed in f2003. I'm not even going to go check - it better be fixed.
There were cases in f90/f95 where empty derived types could be useful,
but they were at least rare. With inheritance, they aren't rare.

Anyway, an empty interface block is fine in f95. See the bnf for
interface-block (R1201 in f95). See 1.6.2(3) for explanation of the bnf
form used. The explanation says that it may occur zero or more times.

There is certainly no justification at all for rejecting the public
statement. You won't find it in the standard because it isn't there.

I might add that I don't consider this to be that much of a corner case.
I can see uses for it, much like an empty extensible derived type. In
fact, I'd say the situations were similar. This allows you to define a
generic that has no specifics as yet, but will presumably be extended in
other scopes that USE this module.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Re: John Resig has a new idea
    ... Your test-case has no style sheets and so the - document.styleSheets - collection will be empty in its case. ... The w3c does not define a standard "collection" interface with an item method. ... The w3c HTML DOM mentions the use of property accessors for HTMLCollection. ...
    (comp.lang.javascript)
  • Re: IBindingList AllowNew is FALSE!!!
    ... It is possible because - and now the fun starts - AddNew is called by the ... interface. ... > collections of other business objects up to three or four levels deep. ... > empty the CurrencyManager keeps trying to call the AddNew method of the ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Purpose of an empty Interface ??
    ... Interface, "javax.jms.ConnectionFactory". ... This interface was empty. ... This question does not apply to JAVA but to general OOP. ... There are two different schools of thought on whether empty interfaces ...
    (comp.programming)
  • Re: Purpose of an empty Interface ??
    ... Interface, "javax.jms.ConnectionFactory". ... This interface was empty. ... "empty" abstract classes and interfaces in other languages. ... There are two different schools of thought on whether empty interfaces ...
    (comp.programming)
  • Re: A C++ Whishlist
    ... > not a reasonable thing to expect from the standard library. ... of the ECMA Script standard you will learn that complexity doesn't stop ... > The simple separation of interface and implementation that header files ...
    (comp.lang.cpp)