public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
To: Jerry DeLisle <jvdelisle@verizon.net>,
	fortran@gcc.gnu.org, 	gcc-patches@gcc.gnu.org
Subject: Re: [patch,fortran] F2003 Inquire features
Date: Mon, 07 Apr 2008 21:52:00 -0000	[thread overview]
Message-ID: <20080407211424.GA27487@physik.fu-berlin.de> (raw)

> Attached is the final patch of this installment.

Thanks for the patch!

> Regression tested and NIST tested.  I am still working up test cases to
> add.
> 
> OK to commit?

OK after fixing the issues mentioned below.

Index: gcc/fortran/io.c:
| 
|        if (open->encoding->expr_type == EXPR_CONSTANT)
|  	{
| -	  static const char * encoding[] = { "UTF-8", "DEFAULT", NULL };
| +	  static const char * encoding[] = { "DEFAULT", NULL };

Add a TODO: UTF-8 there. (In the library there is already such a TODO.)


Index: libgfortran/io/inquire.c:
+	  case ROUND_UNSPECIFIED:
+	    p = "UNSPECIFIED";
+	    break;

This is wrong.

The standard mandates ("9.9.1.26 ROUND= specifier in the INQUIRE statement"):
"The scalar-default-char-variable in the ROUND= specifier is assigned
 the value UP, DOWN, ZERO, NEAREST, COMPATIBLE, or PROCESSOR_DEFINED,
 corresponding to the I/O rounding mode in effect for a connection for
 formatted input/output. If there is no connection or if the connection
 is not for formatted input/output, the scalar-default-char-variable is
 assigned the value UNDEFINED. The processor shall return the value
 PROCESSOR_DEFINED only if the I/O rounding mode currently in effect
 behaves differently than the UP, DOWN, ZERO, NEAREST, and COMPATIBLE
 modes."

Therefore, if the rounding mode has not been specified, the default
rounding mode should be returned. As we currently do not know which one
we have, we should return "PROCESSOR_DEFINED". If you replace the
string, please add also TODO there.

As soon as we figured out which rounding mode gfortran currently has
or which default rounding mode we want to have, we should return this
one instead. (Unless, it turns out that it neither of the up/down/zero/
nearest/compatible, which I do not think.) On my system I have
"COMPATIBLE"; the rounding seems to depend on the system libc's printf
and POSIX says that the rounding is system dependent, which means that
"PROCESSOR_DEFINED" is the right choice - at least for the moment.

Tobias

             reply	other threads:[~2008-04-07 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-07 21:52 Tobias Burnus [this message]
2008-04-07 22:38 ` Jerry DeLisle
     [not found] <1207551203.3028.25.camel@lenova.localdomain>
     [not found] ` <1207551605.19244.1.camel@lenova.localdomain>
2008-04-07 20:50   ` Jerry DeLisle

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=20080407211424.GA27487@physik.fu-berlin.de \
    --to=tobias.burnus@physik.fu-berlin.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle@verizon.net \
    /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).