Hi Steve, On 11/19/23 01:04, Steve Kargl wrote: > On Sat, Nov 18, 2023 at 11:12:55PM +0100, Harald Anlauf wrote: >> Regtested on x86_64-pc-linux-gnu. OK for mainline? >> > > Not in its current form. > >> { >> + int first_int_kind = -1; >> + bool f2023 = ((gfc_option.allow_std & GFC_STD_F2023) != 0 >> + && (gfc_option.allow_std & GFC_STD_GNU) == 0); >> + > > If you use the gfc_notify_std(), then you should not need the > above check on GFC_STD_GNU as it should include GFC_STD_F2023. this is actually the question (and problem). For all new features, -std=gnu shall include everything allowed by -std=f2023. Here we have the problem that the testcase is valid F2018 and is silently accepted by gfortran-13 for -std=gnu and -std=f2018. I prefer to keep it that way also for gfortran-14, and apply the new restrictions only for -std=f2023. Do we agree on this? Now that should happen for -std=gnu -pedantic (-w)? I have thought some more and came up with the revised attached patch, which still has the above condition. It now marks the diagnostics as GNU extensions beyond F2023 for -std=f2023. The mask f2023 in the above form suppresses new warnings even for -pedantic; one would normally use -w to suppress them. Now if you remove the second part of the condition, we will regress on testcases system_clock_1.f90 and system_clock_3.f90 because they would emit GNU extension warnings because the testsuite runs with -pedantic. The options I see: - use patch-V1 (although diagnostics are better in V2), - use patch-V2, - use patch-V2, but enable -pedantic warnings for previously valid code, and adjust the failing testcases - ??? > Elsewhere in the FE, gfortran uses gfc_notify_std() to enforce > requirements of a Fortran standard. The above would be > > if (count->ts.kind < gfc_default_integer_kind > && gfc_notify_std (GFC_STD_F2023, "COUNT argument to SYSTEM_CLOCK " > "at %L must have kind of at least default integer", > &count->where)) I tried this first, and it did not do the job. The logic in gfc_notify_std is: estd = std & ~gfc_option.allow_std; /* Standard to error about. */ error = (estd != 0); if (error) msg = notify_std_msg (estd); ... So for -std=f2023 we get estd=0, error=false, and *NO* error. For -std=f2018 we get error=true and an error message. This is the opposite of what is needed. Can you please try yourself? > Note, gfc_notify_std() should add the 'Fortran 2023: ' string, > if not, that should be fixed. This I did fix. > Of course, I seldom provide patches if others don't have a comment > then do as you like. Thanks for your feedback! Harald