public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Jerry DeLisle <jvdelisle@verizon.net>
Cc: Fortran List <fortran@gcc.gnu.org>,
	  gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [patch, libfortran] PR33253 namelist: reading back a string with   apostrophe
Date: Tue, 04 Sep 2007 09:43:00 -0000	[thread overview]
Message-ID: <46DD28A3.9020601@net-b.de> (raw)
In-Reply-To: <46DC598F.50905@verizon.net>

Hi Jerry,

Jerry DeLisle wrote:
> The title of this PR is a bit misleading.  The failure occurs with a
> string without the apostrophe as well.  The problem here is that when
> reading a string, we look at the first character and see if it is a
> delimiter ' or " .  If not we would skip out and not read the rest of
> the string.

For me, it does not fully work yet. Using the following program:
--------------------
program main
  implicit none
  character(len=3) :: a
  namelist /foo/ a
  open(10,delim="APOSTROPHE")
  a = "a'a"
  write(10,foo)
  write (*,foo)
  rewind 10
  read (10,foo)
end program main
--------------------

ifort, NAG f95, g95, openf95 write all (modulo spacing):

 &FOO
 A       = 'a''a'
 /

gfortran writes:

&FOO
 A='a'a',  /

and has then problems reading this back:
Fortran runtime error: Invalid string input in item 0

(As gfortran properly reads  A='a''a' this seems to be only a writing
and not a reading problem.)

Tobias

  parent reply	other threads:[~2007-09-04  9:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-03 19:01 Jerry DeLisle
2007-09-03 19:12 ` Steve Kargl
2007-09-04  9:43 ` Tobias Burnus [this message]
2007-09-05  0:35   ` Jerry DeLisle
2007-09-05  5:32   ` Jerry DeLisle
2007-09-05  8:30     ` Tobias Burnus
2007-10-01  5:12 Jerry DeLisle
2007-10-01  6:59 ` FX Coudert
     [not found]   ` <47010739.9060204@verizon.net>
2007-10-02 23:31     ` Jerry DeLisle
2007-10-03  0:21       ` 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=46DD28A3.9020601@net-b.de \
    --to=burnus@net-b.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).