public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
To: Jerry D <jvdelisle2@gmail.com>
Cc: rep.dot.nop@gmail.com, gfortran <fortran@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, libgfortran] Part 2: PR105456 Child I/O does not propage iostat
Date: Thu, 29 Feb 2024 10:47:05 +0100	[thread overview]
Message-ID: <20240229104705.62e46010@nbbrfq.loc> (raw)
In-Reply-To: <943c3685-c4d4-4f22-8b65-6336f8770043@gmail.com>

On Wed, 28 Feb 2024 21:29:06 -0800
Jerry D <jvdelisle2@gmail.com> wrote:

> The attached patch adds the error checks similar to the first patch 
> previously committed.
> 
> I noticed a redundancy in some defines MSGLEN and IOMSG_LEN so I 
> consolidated this to one define in io.h. This is just cleanup stuff.
> 
> I have added test cases for each of the places where UDTIO is done in 
> the library.
> 
> Regressions tested on x86_64.
> 
> OK for trunk?

I think the commit hooks will complain about several missing spaces
before open brace; See contrib/check_GNU_style.py /tmp/pr105456-3.diff

Would it make sense to introduce and use an internal helper like trim()?
Or would it be possible to trim the message in generate_error_common()?

And, just for my own education, the length limitation of iomsg to 255
chars is not backed by the standard AFAICS, right? It's just our
STRERR_MAXSZ?

thanks!

> 
> Regards,
> 
> Jerry
> 
> commit 640991bd6b83df4197b2eaec63d1e0e695e48b75
> Author: Jerry DeLisle <jvdelisle@gcc.gnu.org>
> Date:   Wed Feb 28 20:51:06 2024 -0800
> 
>      Fortran: Add user defined error messages for UDTIO.
> 
>      The defines IOMSG_LEN and MSGLEN were redundant so these are combined
>      into IOMSG_LEN as defined in io.h.
> 
>      The remainder of the patch adds checks for when a user defined
>      derived type IO procedure sets the IOSTAT or IOMSG variables
>      independent of the librrary defined I/O messages.
> 
>              PR libfortran/105456
> 
>      libgfortran/ChangeLog:
> 
>              * io/io.h (IOMSG_LEN): Moved to here.
>              * io/list_read.c (MSGLEN): Removed MSGLEN.
>              (convert_integer): Changed MSGLEN to IOMSG_LEN.
>              (parse_repeat): Likewise.
>              (read_logical): Likewise.
>              (read_integer): Likewise.
>              (read_character): Likewise.
>              (parse_real): Likewise.
>              (read_complex): Likewise.
>              (read_real): Likewise.
>              (check_type): Likewise.
>              (list_formatted_read_scalar): Adjust to IOMSG_LEN.
>              (nml_read_obj): Add user defined error message.
>              * io/transfer.c (unformatted_read): Add user defined error
>              message.
>              (unformatted_write): Add user defined error message.
>              (formatted_transfer_scalar_read): Add user defined error 
> message.
>              (formatted_transfer_scalar_write): Add user defined error 
> message.
>              * io/write.c (list_formatted_write_scalar): Add user 
> defined error message.
>              (nml_write_obj): Add user defined error message.
> 
>      gcc/testsuite/ChangeLog:
> 
>              * gfortran.dg/pr105456-nmlr.f90: New test.
>              * gfortran.dg/pr105456-nmlw.f90: New test.
>              * gfortran.dg/pr105456-ruf.f90: New test.
>              * gfortran.dg/pr105456-wf.f90: New test.
>              * gfortran.dg/pr105456-wuf.f90: New test.


  reply	other threads:[~2024-02-29  9:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29  5:29 Jerry D
2024-02-29  9:47 ` Bernhard Reutner-Fischer [this message]
2024-02-29 17:36   ` Jerry D
2024-02-29 18:13     ` Steve Kargl
     [not found]       ` <033ebcdd-6e25-4af7-9012-3338978751d8@gmail.com>
     [not found]         ` <05A1AEE6-6A68-4D4F-8BEA-6E87969E19E7@gmail.com>
2024-03-05  3:15           ` Jerry D
2024-03-05 21:30             ` rep.dot.nop
2024-03-05 21:37             ` Harald Anlauf
2024-03-05 21:37               ` Harald Anlauf
2024-03-05 21:51               ` Harald Anlauf
2024-03-05 21:51                 ` Harald Anlauf
2024-03-06  4:06                 ` Jerry D
2024-03-06  6:06                   ` Steve Kargl
2024-03-06 17:13                   ` Harald Anlauf
2024-03-06 17:13                     ` Harald Anlauf
2024-03-07  4:01                     ` Jerry D

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=20240229104705.62e46010@nbbrfq.loc \
    --to=rep.dot.nop@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle2@gmail.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).