[Patch, Fortran] PR30940 - Sequence association and actual/formal argument element sequence compile time checks

Tobias Burnus burnus@net-b.de
Fri Jun 29 23:22:00 GMT 2007


:ADDPATCH fortran:

This patch addresses two related but separate problems:

* gfortran did not support the Fortran 2003 sequence association of
character strings and character arrays. As ISO C Bindings may only be
used for character(len=1) arrays, this feature is used by many Fortran
2003 programs.

* Additionally, gfortran did only very few checks whether the length of
the actual argument was at least as long as the dummy argument. I added
a couple more checks. These checkings spit out only a warning; I also
downgraded some of the previous error to a warning. Comments, suggestions?


In the Fortran 2003 standard one finds this in Section "12.4.1 Actual
arguments, dummy arguments, and argument association"
and especially in Subsection "12.4.1.5 Sequence association".

I do not test for neither array substrings nor for array element
designators; I leave this as exercise to someone else ...

I'm almost positive that this patch will reject a real-world application
which works - and might even be valid. But lacking imagination I cannot
image why a valid program would be rejected.

As collateral damage it kind of fixes PR 24886. (It does not fix the
problem due to missing whole-file checking; but if one puts the file
into a "contains", it works; I think it worked even before my patch.)


Build and regression tested on x86_64-unknown-linux-gnu.
Ok for the trunk?

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sequence_assoc.diff
Type: text/x-patch
Size: 18309 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070629/90219078/attachment.bin>


More information about the Gcc-patches mailing list