From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 004913858D20; Thu, 29 Feb 2024 09:48:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 004913858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 004913858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709200096; cv=none; b=HznF3n6H87VQoKdPm0kLtWflevoYWJsvgkJGm90VWWO/C/nWkDS8Itn+bqOud3TFCc5J1wgbXJ/ROqj1V6HqpjvfHk7QpWcESs9Uqpt8BWmm7qQdBfHZAuMMdisvtSGJcm0fAEolLZoyezML4ZPEfpg+wRgatvYU7KesturYU2I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709200096; c=relaxed/simple; bh=wv19FCuFzTtcrTn7DWmOODA+YQ8Ty0NvnkOrFl2M/yU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=L1JI6IZ1kkNE1Yt3/fUBzHyYDJ0RRnHR3W1dWHwm58wjx5m0A0OKP6O608+3g85IQytGUfd/0d9oewFwdZW9KZkXh+MFbEE6OY+oozwyCweGmHUWxv7WYwpTmYC+P2nYpuM0GCHiX1Ojh1sQuE+HQybN4gflCy5Tv7D0X+eOC3I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a3f4464c48dso100490466b.3; Thu, 29 Feb 2024 01:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709200083; x=1709804883; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Lc/VtLO99sAN1Vv5YGilCwXaKhZ+y3pwzZpWZWk126s=; b=Uo9LaVTIP5/4TBDw+VO3n4ddDMqz+kywbLSnOYE+M724oDZKsAOO0tpy79mSK9M8YJ 9yPZX9dWN032HTHAU++BIEOVR9KZj6GLQ5bJyK7IGG/4lMC8uXczgtlxlFcVQSpNTrBd Y8FEDS0s+nGgxH4q0GrI/aHw+6K3Ciu/uqPkj22bu4ViIMDrV/IRDh/DRIgPfafTL4et tGgOXm7YPkkfBYB5e0FtxSlYIwgTEIr/qprqRRmTsN6i/cZcjyMPfHSIKqLGJhR5/ORN Caczgrd82+zeQMePMGVEQ0jmWA+06SJ1R4wAv0GCxfJpegRMW1+KZi9UVQnDO0DnXh56 Gisg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709200083; x=1709804883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lc/VtLO99sAN1Vv5YGilCwXaKhZ+y3pwzZpWZWk126s=; b=Rp4xX288VC/2vmfl4iQxa0/RzH6/VHyrJT/6GGj8qNksWwSKxyRtGvzDMr9Xt2cWHA KQBXzcBdyekN0Qzbm6tObyeXCmDuPzCDvzjGU5C9NZ1Uqf1b9BOZKzdb4lNE4HkehHgH xTV3FVEn9HACbMU1Ltkb1LhUEXMqRUw0QMnOK2bpM734G8GyDB2vgpBd3YMrBn0yTT1I 7odV9RogZnxuOnSS8NzA4eIfBrNbgANNMqv/HlfWQH0XM7MT8I3juOjd4R6xzWtJbjNX AsCz86M1TLjBljP1VUbAYqGFpNEiW4bBbCaDqeznA2JvoPlU/NXIO72kuRlwGrDb/9A1 R7dQ== X-Forwarded-Encrypted: i=1; AJvYcCWNHuKbaVTwD2N+lm1tL9NhxSQErI0SvL/74RG0lZCQ0nlmbBJodqugcmwfVyFvUdZsfh51kRnCf/ZXE1FNPUg7qh422pW9H2fyyDNJ1pI+A4C81nTLW2BWy1dnuw== X-Gm-Message-State: AOJu0YwtwvTqXzWVaKCABwthtZc2mRaqOdtZN6aalZ+R0fqTLdb4vgDk e+5KxuAMFPE92Vrjr5ZQVS/Gp366JhJPRMYNLBexbN8iTAkckIDw X-Google-Smtp-Source: AGHT+IHclxPfX7nd8Tx/NWj4VWPGlOltb/qo2rZOFa0R1rADXsjOgdTxTziedwuob5YvECgAqCmcYA== X-Received: by 2002:a17:906:24db:b0:a44:4ed8:6a35 with SMTP id f27-20020a17090624db00b00a444ed86a35mr568117ejb.66.1709200083051; Thu, 29 Feb 2024 01:48:03 -0800 (PST) Received: from nbbrfq.loc (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id f26-20020a170906139a00b00a4417c46efbsm504141ejc.82.2024.02.29.01.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:48:02 -0800 (PST) Date: Thu, 29 Feb 2024 10:47:05 +0100 From: Bernhard Reutner-Fischer To: Jerry D Cc: rep.dot.nop@gmail.com, gfortran , gcc-patches Subject: Re: [patch, libgfortran] Part 2: PR105456 Child I/O does not propage iostat Message-ID: <20240229104705.62e46010@nbbrfq.loc> In-Reply-To: <943c3685-c4d4-4f22-8b65-6336f8770043@gmail.com> References: <943c3685-c4d4-4f22-8b65-6336f8770043@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 28 Feb 2024 21:29:06 -0800 Jerry D 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 > 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.