public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: Steve Kargl via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Tobias Burnus <tobias@codesourcery.com>,
	HAO CHEN GUI <guihaoc@linux.ibm.com>,
	fortran <fortran@gcc.gnu.org>,
	Segher Boessenkool <segher@kernel.crashing.org>,
	David <dje.gcc@gmail.com>, "Kewen.Lin" <linkw@linux.ibm.com>,
	Peter Bergner <bergner@linux.ibm.com>
Subject: Re: [PATCH, gfortran] Escalate failure when Hollerith constant to real conversion fails [PR103628]
Date: Wed, 1 Mar 2023 17:10:46 -0800	[thread overview]
Message-ID: <Y//3lu//Zls35yKi@troutmask.apl.washington.edu> (raw)
In-Reply-To: <20230302010732.1db1d521@nbbrfq>

On Thu, Mar 02, 2023 at 01:07:32AM +0100, Bernhard Reutner-Fischer wrote:
> On Wed, 1 Mar 2023 07:39:40 -0800
> Steve Kargl via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> > In fact, Hollerith should be hidden behind a -fallow-hollerith
> > option and added to -std=legacy.
> 
> While i'd be all for that, in my mind this will block off literally all
> consultants and quite some scientists unless we error out
> with a specific hint to an option that re-enable this.
> 
> So yea, but please forgivingly for the decades to come?
> 

It has already been decades.  It seems to me that only
way to motivate people to fix their code is to nag.

Hollerith is pre-F77 era code.  gfortran already provide a
warning.  The warning should be made into an error, and yes,
it can point to -fallow-hollerith.  The option would downgrade
the error to a warning.  The only way to suppress the warning
is to suppress all warnings with -w.   See -fallow-invalid-boz.

% cat > a.f90
program foo            ! free-form source code is post-f77.
   real :: b = 4H1234  ! No code, in particular, legacy has 
   print *, b          ! initialization expressions.
end program foo
% gfcx -o z a.f90
a.f90:2:14:

    2 |    real :: b = 4H1234
      |              1
Warning: Extension: Conversion from HOLLERITH to REAL(4) at (1)
a.f90:2:18:

    2 |    real :: b = 4H1234
      |                  1
Warning: Legacy Extension: Hollerith constant at (1)

-- 
Steve

  reply	other threads:[~2023-03-02  1:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c4d05663-57a2-40be-3fba-270239b52ee0@linux.ibm.com>
2023-03-01  9:40 ` Tobias Burnus
2023-03-01 15:39   ` Steve Kargl
2023-03-02  0:07     ` Bernhard Reutner-Fischer
2023-03-02  1:10       ` Steve Kargl [this message]
2023-03-02  0:00   ` Bernhard Reutner-Fischer
2023-03-02  2:27 ` Kewen.Lin

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=Y//3lu//Zls35yKi@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guihaoc@linux.ibm.com \
    --cc=linkw@linux.ibm.com \
    --cc=rep.dot.nop@gmail.com \
    --cc=segher@kernel.crashing.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).