[Bug libfortran/46373] New: fflush called when reading from a string

2010-11-08 Thread e01reynier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46373

   Summary: fflush called when reading from a string
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libfortran
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: e01reyn...@gmail.com


When reading a integer from a string (ie READ(string,'(I3)') number) it calls
fflush from flush_if_preconnected routine inside data_transfer_init routine.
It causes me trouble in a C thread waiting for keyboard calling getc.
Is there a valid reason for calling fflush while reading a string ?


[Bug libfortran/46373] fflush called when reading from a string

2010-11-08 Thread e01reynier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46373

--- Comment #3 from e01reynier at gmail dot com 2010-11-09 07:50:37 UTC ---
(In reply to comment #1)
> See the documentation that comes with gfortran.
> 
> You can use 
> 
> * GFORTRAN_UNBUFFERED_ALL:: Don't buffer I/O for all units.
> * GFORTRAN_UNBUFFERED_PRECONNECTED:: Don't buffer I/O for preconnected units.
> 
> to control the buffering of IO.

I try under bash with:
  export GFORTRAN_UNBUFFERED_ALL=y
or
  export GFORTRAN_UNBUFFERED_PRECONNECTED=y
but fflush is always called when I read from a string.

Anyway reading from a string has nothing to do with buffered I/O !
Why the hell is fflush called ?


[Bug libfortran/46373] fflush called when reading from a string

2010-11-08 Thread e01reynier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46373

--- Comment #4 from e01reynier at gmail dot com 2010-11-09 07:54:58 UTC ---
(In reply to comment #2)

> An internal unit fflush is:

Is there really an internal unit involved when reading an integer from a string
?


[Bug libfortran/46373] fflush called when reading from a string

2010-11-09 Thread e01reynier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46373

--- Comment #6 from e01reynier at gmail dot com 2010-11-09 13:39:33 UTC ---
It should solve my problem.
Thanks a lot !


[Bug libfortran/46373] fflush called when reading from a string

2010-11-10 Thread e01reynier at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46373

--- Comment #9 from e01reynier at gmail dot com 2010-11-10 08:13:54 UTC ---
(In reply to comment #8)
> Aside from Janne's comments about getting rid of this function completely, I
> think the little fix is a candidate for back port to 4.4 and 4.5. What do you
> think Janne?

It would be nice.