Dear all,
we might want to update changes.html to reflect this. How about:
diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index 403feb06..9b16f5e3 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -284,6 +284,11 @@ a work-in-progress.</p>
<h3 id="fortran">Fortran</h3>
<ul>
+ <li>The compiler now accepts the <code>-std=f2023</code> option, which
+ has been added in preparation of support of Fortran 2023. This option
+ increases the line-length limit for source in free-form to 10000, and
+ statements may have up to 1 million characters.
+ </li>
<li> With the <code>-save-temps</code> option, preprocessed files
with the <code>.fii</code> extension will be generated from
free-form source files such as <code>.F90</code> and
Cheers,
Harald
Am 17.11.23 um 12:38 schrieb Tobias Burnus:
Hi Harald, hi all,
On 16.11.23 20:30, Harald Anlauf wrote:
On 11/16/23 14:01, Tobias Burnus wrote:
This adds -std=f2023, which is mostly a prep patch for future changes.
...
(B) In "6.3.2.6 Free form statements":
Fortran 2018: "A statement shall not have more than 255 continuation
lines."
Fortran 2023: "A statement shall not have more than one million
characters."
this is really a funny change: we're not really prepared to handle
this.
I can confirm this. I tried to get it working in scanner.cc but due to
the re-parsing it is quite difficult to get it right; the main problem
is that we keep reparsing code ("gfc_current_locus = old_loc"), such
that a simple count will be wrong.
→ Now tracked at https://gcc.gnu.org/PR112586
According to the standard one can have 999999 lines with only
"&" and then an ";", but then only 100 lines with 10000 characters.
I believe a single '&' is not valid, you either need '&&' or something
else + '&'; thus, you can have only half a million lines + 1.
In the code, I still use 1,000,000 but now with a comment.
There is a similar wording for fixed-form which you overlooked:
Ups - fixed.
If you think that we need testcases for fixed-form, add them,
or forget them. I don't bother.
I added one.
- there are existing testcases continuation_5.f, continuation_6.f,
thus I suggest to rename your new continuation_{5,6}.f90 to
continuation_17.f90+ .
Done. We are rather inconsistent whether we enumerate <file>.f{,90}
together or separately; as the suffix is shown, either works.
- I don't understand your new testcase line_length_14.f90 .
This is supposed to test -std=gnu, but then -std=gnu is not a
standard but a moving target, which is why you had to adjust
existing testcases.
So what does it buy us beyond line_length_1{2,3}.f90 ?
Well, it ensures that the warning is not only shown for -std=f2023 but
also for -std=f2028 and (current -std=gnu). In general, I think it is
useful to check the lower and the upper bound.
I have now removed it - as it is unlikely that we would regress on such
changes.
PPS: I did not bother adding .f23 as file extension; I believe that also
.f18 is unsupported.
I never use extensions other than .f90 for portable code.
Likewise - especially as '.f95' starts out as Fortran code that
complies to -std=f95 but slowly Fortran 2003 or later code creeps in. I
think that's fine but then one can also directly use .f90. (Most code
does so.)
Unless there are follow up comments, I will commit it later today.
Thanks for the comments!
Tobias
PS: I fixed the wording issue in the subject line of the email and
header. I first wrote 'support' but that sounded a bit as if F2023 is
supported. Hence, I wrote 'Accept' and did not remove 'support'.
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,
80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer:
Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;
Registergericht München, HRB 106955