public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gmx.de>
To: Tobias Burnus <tobias@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	fortran <fortran@gcc.gnu.org>
Subject: Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
Date: Tue, 2 Jan 2024 20:31:15 +0100	[thread overview]
Message-ID: <b652d029-3456-46b9-bff8-d0fd1e36667f@gmx.de> (raw)
In-Reply-To: <6b62f178-e3c4-4bdb-b7cc-eb57477cd27d@codesourcery.com>

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


WARNING: multiple messages have this Message-ID
From: Harald Anlauf <anlauf@gmx.de>
To: gcc-patches@gcc.gnu.org
Cc: fortran@gcc.gnu.org
Subject: Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
Date: Tue, 2 Jan 2024 20:31:15 +0100	[thread overview]
Message-ID: <b652d029-3456-46b9-bff8-d0fd1e36667f@gmx.de> (raw)
Message-ID: <20240102193115.MKIW1urEVicdq1G7a4KKfAlK0Kwq9XHsfLIYHVp22vY@z> (raw)
In-Reply-To: <6b62f178-e3c4-4bdb-b7cc-eb57477cd27d@codesourcery.com>

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



  parent reply	other threads:[~2024-01-02 19:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 13:01 [Patch] Fortran: Accept -std=f2023 support, " Tobias Burnus
2023-11-16 19:30 ` Harald Anlauf
2023-11-16 19:30   ` Harald Anlauf
2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
2023-11-17 12:06     ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 Mikael Morin
2023-11-17 19:07     ` Harald Anlauf
2023-11-17 19:07       ` Harald Anlauf
2024-01-02 19:31     ` Harald Anlauf [this message]
2024-01-02 19:31       ` Harald Anlauf
2024-01-02 19:37       ` Steve Kargl
2024-01-02 19:51         ` Harald Anlauf
2024-01-02 19:51           ` Harald Anlauf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b652d029-3456-46b9-bff8-d0fd1e36667f@gmx.de \
    --to=anlauf@gmx.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).