This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch,wip] warn on noncontiguous pointers
- From: Cesar Philippidis <cesar at codesourcery dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>, "Bader, Reinhold" <Reinhold dot Bader at lrz dot de>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Mon, 1 Oct 2018 06:36:22 -0700
- Subject: Re: [patch,wip] warn on noncontiguous pointers
- References: <6c7d4e6ddec64bd8a326a95591b2bb47@lrz.de> <f48efd1b-65c9-4077-dd0c-b2d9fe1f6a54@netcologne.de> <2e72ca261ac34d0b839c112f8cee3600@lrz.de> <efd5e6a9-b967-8cb2-b1f0-d613fa48b6a4@netcologne.de>
On 09/30/2018 11:12 AM, Thomas Koenig wrote:
> Am 28.09.18 um 07:12 schrieb Bader, Reinhold:
>> Looking at 5.3.8.1 (Fortran 2008 for the sake of this discussion),
>> we have that
>> an object that has the DIMENSION attribute is an array. array-spec
>> includes deferred-shape-spec-list,
>> so any object declared with deferred shape is an array.
>
> OK, I see, so this code is indeed legal. Thanks!
>
> @Cesar: The idea behind your patch is sound. I think this would
> fit into the "legal, but can sometimes bite you" category,
> so I think would be better with -Wextra (where we accept that
> there might be quite a few false positives).
>
> Could you adapt your patch accordingly and also add two test cases,
> one testing for the absence of the warning/error with normal
> options, and one for the warning with -Wextra?
Yes, sure.
Thanks,
Cesar