[so] Probleme de scriere la stderr pe windows
Maximilian Machedon
maximilian.machedon at gmail.com
Mon Apr 7 17:22:36 EEST 2008
Daca programul nu se termina normal, nu mai ai flush "gratuit". :-P
exec pare un candidat bun pentru a explica problema. :-)
2008/4/7 Lucian Adrian Grijincu <lucian.grijincu at gmail.com>:
> > Maximilian Machedon <maximilian.machedon at gmail.com> wrote:
> > Ma rog.. se face flush cand se termina programul (normal), deci
> probabil nu
> > e de la asta. :-P
>
> 2008/4/7 Tiugan Radu <tiuganradu at yahoo.com>:
> > Asa m-am gandit si eu ca la terminarea programului se face flush. Dar
> chit
> > ca am pus \n nu se facea. Am rezolvat cu un fflush.
>
> How do you like them apples?
>
> Standardul C spune ca la exit(3) trebuie să se inchida/flush-uiasca
> streamurile deschise:
> <q>
> Before termination it performs the following functions in the order
> listed:
> 1. Call the functions registered with the atexit(3) function,
> in
> the reverse order of their registration.
> 2. Flush all open output streams.
> 3. Close all open streams.
> 4. Unlink all files created with the tmpfile(3) function.
> ...
> The exit() function conforms to ISO/IEC 9899:1990 (``ISO C89'').
> </q>
>
>
> Altundeva spune că un program care se termină cu "return value;" din
> main() e echivalent cu unul care dă exit(value).
>
> Nu sunt sigur, dar cred ca FILE* sunt acele "streams" de care pomenește
> C89.
>
> din man 3 exit:
> <q>
> All open stdio(3) streams are flushed and closed. Files created
> by
> tmpfile(3) are removed.
> </q>
>
> Mă înșel?
> Dacă da, atunci faptul că nu se face fflush automat ar trebui
> considerat un bug al [g]libc?
>
> --
> Lucian
> _______________________________________________
> so mailing list
> so at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/so/attachments/20080407/61710f68/attachment.htm
More information about the so
mailing list