Flag to warning about shape/alignment-change of explicit shape arrays arguments

Jonatan Öström jonatan.ostrom@fysik.su.se
Tue Jun 4 22:00:00 GMT 2019


> Code contributions are always welcomed.
Haha, the compiler is a very magic black box.


I looked at the document. That sequence association is just the way it's always been, right? But with modern construct like modules and assumed shape, and comparing to numpy etc, this behavior seems unexpected. I wouldn't write a line without this flag if it was available.


Anyway, thanks for your response!


Best regards,

Jonatan


________________________________
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
Sent: Tuesday, June 4, 2019 23:05
To: Jonatan Öström
Cc: fortran@gcc.gnu.org
Subject: Re: Flag to warning about shape/alignment-change of explicit shape arrays arguments

Code contributions are always welcomed.

IMHO, producing a warning for this specific use case
where the F2018 standard specifically describes sequence
association in 15.5.2.11 seems dubious to me.

--
steve

On Tue, Jun 04, 2019 at 08:37:20PM +0000, Jonatan Öström wrote:
> Well there are other such (optional) warnings. Truncated integer division for example, or unused variables. It would be reassuring to know that none of the arrays are changing shape, or to see that only the ones so intended do it, especially after doing changes that affect multiple arrays and/or routines.
>
>
> Regards,
>
> Jonatan
>
> ________________________________
> From: Steve Kargl <sgk@troutmask.apl.washington.edu>
> Sent: Tuesday, June 4, 2019 8:21:27 PM
> To: Jonatan Öström
> Cc: fortran@gcc.gnu.org
> Subject: Re: Flag to warning about shape/alignment-change of explicit shape arrays arguments
>
> On Tue, Jun 04, 2019 at 05:56:01PM +0000, Jonatan Öström wrote:
> > Dear GCC developers, this is a feature request.
> >
> > It would be nice to have a flag like -Wrealign (or -Wreshape
> > or some better name) to warn when an array 'aa' doesn't match
> > the dimensions given in an explicit shape formal argument 'bb'.
> >
>
> Seems odd to issue a warning for standard conforming code.
>
> --
> Steve

--
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow



More information about the Fortran mailing list