Re: porting-to update request

2025-04-04 Thread FX Coudert
Hi,

The error message was fixed by Harald in:

commit fb132276d173907d575ea61fda3b846a9bc6e456
Author: Harald Anlauf 
Date:   2025-03-28 20:31:08 +0100

Fortran: fix spelling of flag -fallow-invalid-boz
 gcc/fortran/ChangeLog:
 * check.cc (gfc_invalid_boz): Correct spelling of compiler 
flag in
hint to -fallow-invalid-boz.


>>> Third, and the main point of this email I guess, is that the
>>> porting-to page should mention this:
>>> https://www.gnu.org/software/gcc/gcc-10/porting_to.html

The changes page for gcc 10 
(https://www.gnu.org/software/gcc/gcc-10/changes.html) says:

"The handling of a BOZ literal constant has been reworked to provide better 
conformance to the Fortran 2008 and 2018 standards. In these Fortran standards, 
a BOZ literal constant is a typeless and kindless entity. As a part of the 
rework, documented and undocumented extensions to the Fortran standard now emit 
errors during compilation. Some of these extensions are permitted with the 
-fallow-invalid-boz option, which degrades the error to a warning and the code 
is compiled as with older gfortran."

BOZ handling was quite inconsistent in early days, and was simplified and 
clarified. Some cases are indeed no longer accepted, but there was really a lot 
of weird old code out there. They should be relatively easy to fix.

If I am not mistaken, the standard way to write your code:

fcn = x * '0100'X

is

fcn = x * int(z’0100')


Best,
FX

Re: porting-to update request

2025-04-04 Thread Sergey Fedorov
I think it is
On Apr 4, 2025 at 2:40 PM +0800, NightStrike , wrote:
> On Fri, Mar 28, 2025 at 2:02 PM NightStrike  wrote:
> >
> > On Tue, Mar 25, 2025 at 11:04 AM NightStrike  wrote:
> > >
> > > Between GCC 9 and 10, the following code now errors out:
> > >
> > > integer function fcn(x)
> > > implicit none
> > > integer, intent(in) :: x
> > > fcn = x * '0100'X
> > > end function fcn
> > >
> > > Error: BOZ constant at (1) uses nonstandard postfix syntax [see
> > > '-fno-allow-invalid-boz']
> > > Compiler returned: 1
> > >
> > > First, the error message is wrong regarding the option to go see:
> > >
> > > gfortran: error: unrecognized command-line option
> > > '-fno-allow-invalid-boz'; did you mean '-fallow-invalid-boz'?
> > >
> > > Second, that option doesn't protect against the aforementioned case.
> > >
> > > Third, and the main point of this email I guess, is that the
> > > porting-to page should mention this:
> > > https://www.gnu.org/software/gcc/gcc-10/porting_to.html
> > >
> > > It talks about argument mismatches, but it doesn't talk about BOZ
> > > literals in expressions, which used to be (perhaps incorrectly)
> > > accepted. There is no new command line option to accept this legacy
> > > code, so the webpage should be updated at a minimum.
> >
> > Should I open a bugzilla PR about this?
>
> Is this email list still active? :)


Re: porting-to update request

2025-04-04 Thread Steve Kargl
On Fri, Apr 04, 2025 at 02:40:06AM -0400, NightStrike wrote:
> 
> Is this email list still active? :)

Are you subscribed to the list?

First reply:

https://gcc.gnu.org/pipermail/fortran/2025-March/061963.html

Second reply:

https://gcc.gnu.org/pipermail/fortran/2025-March/061981.html

-- 
Steve