This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 18 Feb 2007 11:33:48 -0800
- Subject: Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
- References: <45D2CDA1.8060904@net-b.de>
On Wed, Feb 14, 2007 at 09:51:45AM +0100, Tobias Burnus wrote:
> :ADDPATCH fortran:
>
> As found when reading the VALUE implementation by Chris.
>
> gfortran currently accepts "character(*), value", but it shouldn't:
>
> a) the created programs crash
>
> b) the standard disallows it:
> C528 (R501) If the VALUE attribute is specified, the length type
> parameter values shall be omitted or specified by initialization
> expressions.
>
> The question is whether "character(10), value" is allowed. xlf, NAG f95
> and sunf95 reject it; gfortran, g95 and ifort accept it.
>
> I couldn't find anything which disallows "(10)" and as gfortran produces
> the right result (both visually and according to valgrind), I think one
> can allow it. (g95 and ifort both produce wrong code; ifort crashes with
> SIGILL and g95 prints out only the first letter correctly [and valgrind
> complains about access to uninitialized memory].)
>
> I didn't add a test case, if needed I could create one from my PR30783
> example.
>
> Bootstrapped and regression tested on x86_64-unknown-linux-gnu.
>
> Ok for the trunk (only as it is not in 4.2)?
>
OK.
--
Steve