http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38536

--- Comment #22 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-25 
15:44:50 UTC ---
Created attachment 23121
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23121
draft patch, working but too many warnings (cf. test suite failures)

Currently
  c_loc(a(1:2))
produces the warning
  "Array section in '%s' call at %L"
which is correct but possibly misleading as F2008 (contrary to F2003) allows
it.

What F2008 only requires is that the argument is contiguous. At
  http://gcc.gnu.org/ml/fortran/2011-01/msg00180.html
was an early (and very buggy), attached a more advanced patch which gives the
warning:
  "Array might be not contiguous in '%s' call at %L"

However, the patch is also overzealous by warning for "a(1:2:5)" which is
contiguous (as equivalent to "a(1:1)"). But it also warns elsewhere too much.

I think it would be useful to only warn (or error out) if it is known to be
noncontiguous of if one cuts down the number of warnings.

Reply via email to