On 2/1/25 12:49 PM, Harald Anlauf wrote:
Am 01.02.25 um 21:03 schrieb Steve Kargl:
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.
legacy /= moldy.
My intention is to downgrade existing, potentially dangerous
GNU extensions (like this one) carefully to "legacy", but not
with an axe.
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.
I don't see why we shall scare users by making code that is currently
accepted silently, because it is a GNU extension, suddenly to a hard
error.
So why must we be so tough?
$0.02
What do other compilers do? Do they reject it outright?
--