Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
Le 17/11/2023 à 12:38, Tobias Burnus a écrit : Unless there are follow up comments, I will commit it later today. I skimmed quickly through the patch, and noticed one typo to fix: > diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi > index 10387e39501..5f87b330a22 100644 > --- a/gcc/fortran/invoke.texi > +++ b/gcc/fortran/invoke.texi > @@ -958,8 +959,8 @@ The following example will trigger the warning. > @item -Wampersand > Warn about missing ampersand in continued character constants. The > warning is given with @option{-Wampersand}, @option{-pedantic}, > -@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and > -@option{-std=f2018}. Note: With no ampersand given in a continued > +@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008}, @option{-std=f2018} > +and @option{-std=f203}. Note: With no ampersand given in a continued > character constant, GNU Fortran assumes continuation at the first > non-comment, non-whitespace character after the ampersand that > initiated the continuation. s/f203/f2023/
Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
Hi Tobias, On 11/17/23 12:38, Tobias Burnus wrote: Hi Harald, hi all, On 16.11.23 20:30, Harald Anlauf wrote: According to the standard one can have 99 lines with only "&" and then an ";", but then only 100 lines with 1 characters. I believe a single '&' is not valid, you either need '&&' or something else + '&'; thus, you can have only half a million lines + 1. after looking at the F2023 standard again I wonder why they did such a disservice to compiler developers... You are right: a single '&' is not valid. 6.3.2.4 also has: "When used for continuation, the “&” is not part of the statement" And 6.3.2.5 (also 6.3.3.4): "The “;” is not part of the statement". So a million "&"-continued lines is possible in free form. For fixed form, 6.3.3.1 has: "If a source line contains only characters of default kind, it shall contain exactly 72 characters; otherwise, its maximum number of characters is processor dependent." I wonder what I should make out of this... In the code, I still use 1,000,000 but now with a comment. Yeah, for the time being this is the most reasonable solution. Let's claim that the 10^6 line limit is the new GNU standard ;-) Cheers, Harald