[patch, RFC] PR 30146, warning/errors for potentially changing values in DO loops

Thomas Koenig tkoenig@netcologne.de
Sun Oct 28 21:19:00 GMT 2012


Hello world,

the attached patch, which is not in its final stage, implements some
warnings for index variables of DO loops. For the following situations,
errors/warnings are issued when an index loop variable is
passed as an actual argument:

- If the dummy argument has INTENT(OUT). I think an error should be
   issued unconditionally.

- If the dummy argument has INTENT(INOUT). My opinion is that
   a warning should be issued unconditionally, but I am open
   to the opinions that an error would be better, or that it should
   depend on an option.

- If the dummy argument has no INTENT, or if the procedure has no
   explicit interface, I think that there should be a warning
   depending on an option (which I haven't yet implemented).

Opinions?  If there is agreement on the question of which options should
select which errors/warnings, then I will submit a final patch including
some more comments, a ChangeLog entry and a deja-gnuified test case.

	Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: p3.diff
Type: text/x-patch
Size: 6248 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20121028/3ab6649d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: do-test.f90
Type: text/x-fortran
Size: 703 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20121028/3ab6649d/attachment-0001.bin>


More information about the Gcc-patches mailing list