problem with FLUSH while redirecting stdout

problem with FLUSH while redirecting stdout

Hello,

I get the error message "FLUSH--FAILED:: Bad address" when flush() is called for stdout under certain circumstances.
The following small code reproduces the problem:

program flushtest
write(*,*) "now flushing"
call flush(6)
write(*,*) "after flush"
end

Executing this code ("flushtest") produces the standard output

now flushing
after flush

as expected. You can also redirect this output and append it to an existing text file "abc":

flushtest >> abc

This works as expected as long as "abc" does not contain more than 1023 characters! If "abc" contains 1024 or more characters, a series of the special character "^@" is flushed and the abovementioned error message is issued.
Does somebody know the reason for this strange behaviour? Any workarounds for this problem?

(I'm using ifc 7.0 built in October 2002, Kernel 2.4.)

Thanks,
Christian.

publicaciones de 5 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

In the meantime I found an ugly workaround:

flushtest | cat - >> abc

But this of course is not a solution to the problem.

Christian

What happens if you write to unit 6 and not *? By the standard, these are supposed to be distinct.

If you think it's a bug, please report it to Premier Support - the behavior you describe sounds like a bug to me.

Steve

Steve - Intel Developer Support

No matter whether the code writes to unit "*" or "6". I observed the same strange behaviour in both cases.

Since I don't have Premier Support I think that compiler bugs posted in this forum should be considered by the Intel-Premier-Support-people (given they read it) anyway for the next release of the compiler.

Christian.

Anyone who has a copy of the Intel compiler is eligible to sign up for Premier Support and you can report bugs that way. If you have a noncommercial license, you may not get access to fixes right away, but you should at least get an appropriate response, and Premier Support is the only way that problem reports are tracked. This is a user forum, not a formal Intel support channel.

Steve

Steve - Intel Developer Support

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya