public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "clerman at fuse dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/45170]  New: suspected bug in error generated by allocatable character array
Date: Tue, 03 Aug 2010 01:55:00 -0000	[thread overview]
Message-ID: <bug-45170-15125@http.gcc.gnu.org/bugzilla/> (raw)

gfortran tech support,

  When I attempt to compile the program listed below, the following error
messages are printed:

norm@oxford:~/Elements/AllocChar$ more alloccharP.xyz 
alloccharP.f90:6.12:

  character(:), allocatable :: c_Char(:)
            1
Error: Syntax error in CHARACTER declaration at (1)
alloccharP.f90:7.12:

  character(:), allocatable :: io_message
            1
Error: Syntax error in CHARACTER declaration at (1)

  I searched the bug database but could not find this bug listed.

 I am attempting to declare an array of allocatable characters, which I believe
is legal. The Intel 12.0 beta compiler and version 5.2 of the nag compiler both
compile this routine. (The routine, as written, is not correct: the variable
io_message needs to be allocated before it is used in the open statement.)

  Thank you for your attention.

Yours truly,

Norm

Norman S. Clerman

program AllocChar

  integer, parameter :: CHAR_ELEMENTS = 5, FILE_UNIT = 11
  integer :: io_stat
!  character(:), allocatable :: c_Char(CHAR_ELEMENTS)
  character(:), allocatable :: c_Char(:)
  character(:), allocatable :: io_message
  character (*), parameter :: FILE_NAME = "no_file.dat"

!  io_message = "no errors"
!  print *, io_message
!  c_Char = " "
!  c_Char(1: 2) = ["Hello     ", " everyone!"]
!  c_Char(1) = "Hello"
!  c_Char(2) = "everyone"
!  print *, c_Char (1: 2)

  open (unit = FILE_UNIT, file = FILE_NAME, iostat = io_stat, iomsg =
io_message, status = "old")

  print *, io_message

end program AllocChar


-- 
           Summary: suspected bug in error generated by allocatable
                    character array
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: clerman at fuse dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45170


             reply	other threads:[~2010-08-03  1:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03  1:55 clerman at fuse dot net [this message]
2010-08-03  2:31 ` [Bug fortran/45170] " kargl at gcc dot gnu dot org
2010-08-03  5:43 ` [Bug fortran/45170] [F2003] allocatable character lengths burnus at gcc dot gnu dot org
2010-08-03 10:25 ` clerman at fuse dot net
2010-08-15 18:46 ` kargl at gcc dot gnu dot org

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=bug-45170-15125@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).