Intel Fortran doesn't enforce argument kind conformance?

I’ve been working on the framework for this as a side project. It’s about ready to be open-sourced and to start taking community contributions.

I’m curious about what you think this might look like? I can envision a future where changes to the standard are required to come with a set of additions to such a test suite, but I do not believe the committee currently has the bandwidth to start building such a test suite themselves.

Because of legal concerns and because they can be seen as a proprietary asset, etc. it seems vendors have been hesitant to use external tests, or to release their own. So I think a test suite associated with the standard itself avoids those issues the most successfully.

The tests would by definition be runnable so they could also provide useful examples of Fortran features.

Vetting donated tests might take a considerable amount of resources, so I would picture something like a bugzilla approach where the tests could be donated and visible but having to be approved to become part of the official compliance suite.

Whether the standard itself pointed to or included the examples is worth thinking about.

In the past there were several large test suites for F77.

Where the manpower comes from (assuming ChatGPT running on qubits does not make the question mute) for the vetting, or how someone can be selected to approve the submittals? I am not sure.

Having different compiler developers disagreeing on the tests might be a positive or a negative.

It would be interesting to hear what compiler developers want. Is that a useful resource that helps them develop a better product more effiiciently,
or do they not want a large suite available that makes it easier for others to develop compilers (assuming they have a test suite available).

On the wish-list side of things if the more basic tests were fpm packages I think that would make them easily available to a large base of users as examples (so far, you can build fpm from a single file, making it a minimal required infrastructure for all involved).

A testing framework library would be useful. The use of conditionals in the tests is problematic but perhaps a necessary evil.

Any testing framework or other infrastructure requirements would need to be minimal; ideally only needing a Fortran compiler.

Just some initial thoughts. I can imagine additional projects expanding support for the standards committee site and making more manpower available that can contribute to Fortran projects like this even if they are not interested in becoming standards-committee members. So it is not a given that man-power would all come from the current committee.

2 Likes

You’re right, after all this is just an extension. It bothered me in the first place because it hid a bug in my code (I was not using the right integer kind, and I would have found the problem quicker if the compiler had reported the mismatch in the call)

Do you mean that copy-in/copy-out (or just copy-in) association is made, or do you mean that a new pointer (of the converted type) to the original bits is created and passed as the argument?

I agree that it should be easier to invoke standard conformance, with the corresponding warnings and errors, in this case. I was just pointing out that some compilers, both legacy and new, do not do that by default.

The address of the dummy argument is different from the address of the actual argument, which means that a copy-in occured.

1 Like

There’s a lot of confusion about this and other ifort/ifx options. I’ve just returned from a month away, so I didn’t see this discussion earlier. To summarize:

-standard-semantics changes run-time defaults for behaviors that were unspecified in earlier standards but now specified, and the historical default behavior was different from what is now standard. Most of these are variants of -assume. Example: the unit for RECL in unformatted files changes from 4 to 1 with this option. Over time, the defaults for some of these have changed to match the current standard, but others will likely never change for compatibility with old code.

-std controls whether non-standard syntax is reported - you can select the revision of the standard to check against starting with F90. This option does NOT change behavior, unlike a similarly-named option in other compilers. -warn stderrors is needed to force compliance.

-warn interfaces tries to detect mismatches for calls to procedures lacking an explicit interface. Whether it can do so depends on whether the source with the called procedure has been previously compiled. This option is not on by default except in a Windows Visual Studio debug configuration. [no]gen-interfaces is obsolete - the negative form disables generation of the data used for checking; in the past, one needed to say use both options but that hasn’t been true for a long time.

1 Like