public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/43158] New: No default integer descriptor width
@ 2010-02-24 0:37 wchemelewski at gmail dot com
2010-02-24 2:33 ` [Bug fortran/43158] " kargl at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: wchemelewski at gmail dot com @ 2010-02-24 0:37 UTC (permalink / raw)
To: gcc-bugs
With the following code:
INTEGER :: someint
CHARACTER (LEN=40) :: strcounter
WRITE(strcounter,'(I)') someint
The error message is generated:
WRITE(strcounter,'(I)') someint
1
Error: Nonnegative width required in format string at (1)
Which to me just suggests that gfortran does not have the (i believe) standard
behavior of automatically assigning a width to the format descriptor based on
the given integer. However, this only appears to be a problem when using a
character variable/internal file.
--
Summary: No default integer descriptor width
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: wchemelewski at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43158
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/43158] No default integer descriptor width
2010-02-24 0:37 [Bug fortran/43158] New: No default integer descriptor width wchemelewski at gmail dot com
@ 2010-02-24 2:33 ` kargl at gcc dot gnu dot org
2010-02-24 2:36 ` wchemelewski at gmail dot com
2010-02-24 2:43 ` kargl at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-02-24 2:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from kargl at gcc dot gnu dot org 2010-02-24 02:33 -------
(In reply to comment #0)
> With the following code:
>
> INTEGER :: someint
> CHARACTER (LEN=40) :: strcounter
> WRITE(strcounter,'(I)') someint
>
> The error message is generated:
>
> WRITE(strcounter,'(I)') someint
> 1
> Error: Nonnegative width required in format string at (1)
>
> Which to me just suggests that gfortran does not have the (i believe) standard
> behavior of automatically assigning a width to the format descriptor based on
> the given integer. However, this only appears to be a problem when using a
> character variable/internal file.
>
It suggests to me that you need to read a book on Fortran or
the Standard. It also fails for writing to unit=6.
laptop:kargl[207] gfortran44 -o z a.f90
a.f90:2.11:
write(*,'(I)') i
1
Error: Nonnegative width required in format string at (1)
You can get want you by using 'write(strcounter,*) someint'
or 'write(strcounter,'(I0)') someint'.
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43158
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/43158] No default integer descriptor width
2010-02-24 0:37 [Bug fortran/43158] New: No default integer descriptor width wchemelewski at gmail dot com
2010-02-24 2:33 ` [Bug fortran/43158] " kargl at gcc dot gnu dot org
@ 2010-02-24 2:36 ` wchemelewski at gmail dot com
2010-02-24 2:43 ` kargl at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: wchemelewski at gmail dot com @ 2010-02-24 2:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from wchemelewski at gmail dot com 2010-02-24 02:36 -------
Thanks for being a dick, appreciated.(In reply to comment #1)
> (In reply to comment #0)
> > With the following code:
> >
> > INTEGER :: someint
> > CHARACTER (LEN=40) :: strcounter
> > WRITE(strcounter,'(I)') someint
> >
> > The error message is generated:
> >
> > WRITE(strcounter,'(I)') someint
> > 1
> > Error: Nonnegative width required in format string at (1)
> >
> > Which to me just suggests that gfortran does not have the (i believe) standard
> > behavior of automatically assigning a width to the format descriptor based on
> > the given integer. However, this only appears to be a problem when using a
> > character variable/internal file.
> >
>
> It suggests to me that you need to read a book on Fortran or
> the Standard. It also fails for writing to unit=6.
>
> laptop:kargl[207] gfortran44 -o z a.f90
> a.f90:2.11:
>
> write(*,'(I)') i
> 1
> Error: Nonnegative width required in format string at (1)
>
>
> You can get want you by using 'write(strcounter,*) someint'
> or 'write(strcounter,'(I0)') someint'.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43158
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/43158] No default integer descriptor width
2010-02-24 0:37 [Bug fortran/43158] New: No default integer descriptor width wchemelewski at gmail dot com
2010-02-24 2:33 ` [Bug fortran/43158] " kargl at gcc dot gnu dot org
2010-02-24 2:36 ` wchemelewski at gmail dot com
@ 2010-02-24 2:43 ` kargl at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: kargl at gcc dot gnu dot org @ 2010-02-24 2:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from kargl at gcc dot gnu dot org 2010-02-24 02:43 -------
(In reply to comment #2)
> Thanks for being a dick, appreciated.(In reply to comment #1)
>
>
You're welcomed. With my suggested fixes, you'll actually
have standard conforming code.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43158
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-24 2:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24 0:37 [Bug fortran/43158] New: No default integer descriptor width wchemelewski at gmail dot com
2010-02-24 2:33 ` [Bug fortran/43158] " kargl at gcc dot gnu dot org
2010-02-24 2:36 ` wchemelewski at gmail dot com
2010-02-24 2:43 ` kargl at gcc dot gnu dot org
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).