[PATCH] Fortran: different character lengths in array constructor [PR93289]

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Feb 1 20:03:18 GMT 2025


On Sat, Feb 01, 2025 at 07:25:51PM +0100, Harald Anlauf wrote:
> 
> the attached patch downgrades different constant character lengths in an
> array constructor from a GNU to a legacy extension, so that users get a
> warning with -std=gnu.  We continue to generate an error when standard
> conformance is requested.
> 
> Regtested on x86_64-pc-linux-gnu (found one testcase where this
> triggered... :)
> 
> OK for mainline?
> 

My vote is 'no'.

This is either a GNU extension or an error.  It is certainly
not a legacy issue as array constructors simple cannot appear
old moldy *legacy* codes.  

I would be in favor of making it a hard error.  If you believe
gfortan must be able to compile invalid source, then add an option
such as -fallow-invalid-scalar-character-entities-in-array-constructor.

$0.02

-- 
Steve


More information about the Fortran mailing list