As far as I know it from ANSI C and some other language APIs, writing to stderr is always unbuffered, so all error message are immediately written, so mostly all messages are out before an application crashes.
Writing to stderr is rare, so the slow down for unbuffered I/O can be ignored. Regards Patrick ----------------------------------- Wissenschaftliche Hilfskraft Technische Universität Dresden Fakultät Informatik Institut für Technische Informatik Lehrstuhl VLSI-Entwurfssysteme, Diagnostik und Architektur 01062 Dresden -----Original Message----- From: Ghdl-discuss [mailto:ghdl-discuss-boun...@gna.org] On Behalf Of Jonas Baggett Sent: Saturday, June 25, 2016 11:01 AM To: Tristan Gingold <tging...@free.fr>; GHDL discuss list <ghdl-discuss@gna.org> Subject: Re: [Ghdl-discuss] Collaboration in the GHDL project Hi Tristan, I have already made an --unbuffered option work. It disable buffering on stdout, and does line buffering on stderr. Should I also completely disable buffering on stderr ? Currently, a C function is called to disable buffering after reading the --unbuffered option in grt-options.adb. Does it work that way or should I call setvbuf()/setbuf() before each write to stdout/stderr ? What is remaining to do is to make this option work also when a file is open in write mode in VHDL. Jonas Le 23. 06. 16 à 20:43, Tristan Gingold a écrit : > On 23/06/16 20:40, Jonas Baggett wrote: >> >> >> Le 23. 06. 16 à 08:01, Tristan Gingold a écrit : >>> On 23/06/16 07:43, Jonas Baggett wrote: >>>> Hi Tristan, >>>> >>>> I if understand well, what needs to be done is to add the >>>> possibility that each write to either the console or a file can be >>>> unbuffered, right ? Or maybe writes to the console is already >>>> unbuffered. This feature can be done with the the C function fflush >>>> which is already imported in grt-stdio.ads and then call it at the >>>> end of the Put procedures in grt-astdio.adb, right ? >>> >>> I would simply call setvbuf() (or setbuf) on stdout/stderr and after >>> fopen. That would be slightly more efficient. >>> >>> Tristan. >>> >> I think I will start with this issue, finally. Should the unbuffered >> option be passed during elaboration ? > > No, at execution time. There are already an infrastructure to handle > options, see grt-options.adb > > Tristan. _______________________________________________ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Ghdl-discuss mailing list Ghdl-discuss@gna.org https://mail.gna.org/listinfo/ghdl-discuss