[Bug fortran/43849] Add _gfortran_finalize function to close down the library
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 Steven Bosscher changed: What|Removed |Added Status|WAITING |NEW CC||steven at gcc dot gnu.org --- Comment #5 from Steven Bosscher --- (In reply to Dominique d'Humieres from comment #4) > Is this PR still pertinent (2013-12-21)? Yes, it could be necessary to force the shutdown from other libraries that may want to output something and will need the buffers to be flushed for that (e.g. libcaf).
[Bug fortran/43849] Add _gfortran_finalize function to close down the library
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 Dominique d'Humieres changed: What|Removed |Added Status|UNCONFIRMED |WAITING Last reconfirmed||2013-12-21 Ever confirmed|0 |1 --- Comment #4 from Dominique d'Humieres --- Is this PR still pertinent (2013-12-21)?
[Bug fortran/43849] Add _gfortran_finalize function to close down the library
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849 Janne Blomqvist changed: What|Removed |Added CC||jb at gcc dot gnu.org --- Comment #3 from Janne Blomqvist 2010-11-03 16:31:08 UTC --- In runtime/main.c we have static void __attribute__((destructor)) cleanup (void) { close_units (); if (please_free_exe_path_when_done) free ((char *) exe_path); } As this function is marked with the destructor attribute, it will be called when the library is unloaded during program shutdown. It might make sense to add fbuf_flush(u); sflush(u); to some appropriate place in unit.c(close_unit_1). That is, make sure to flush the unit as part of the closing procedure.
[Bug fortran/43849] Add _gfortran_finalize function to close down the library
--- Comment #2 from burnus at gcc dot gnu dot org 2010-04-22 13:29 --- Forgot to mention that one can then also print the exception status: "8.4 STOP and ERROR STOP statements" (F2008 FDIS): "If any exception (cf. 14 Exceptions and IEEE arithmetic) is signaling on that image, the processor shall issue a warning indicating which exceptions are signaling; this warning shall be on the unit identified by the named constant ERROR_UNIT (13.8.2.8). It is recommended that the stop code is made available by formatted output to the same unit." -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849
[Bug fortran/43849] Add _gfortran_finalize function to close down the library
--- Comment #1 from burnus at gcc dot gnu dot org 2010-04-22 13:19 --- Thus: a) Create a function named, e.g., _gfortran_shutdown/_gfortran_finalize, which calls flush_all_units (); close_units (); b) Call it from: _gfortran_abort _gfortran_stop_numeric; _gfortran_stop_string; _gfortran_error_stop_string _gfortran_error_stop_numeric (not yet existing) and maybe from the run-time error calls such as _gfortran_runtime_error _gfortran_runtime_error_at c) Change trans-decl.c's create_main_function to call it d) Update gfortran.texi e) Add a call to the gfortran CAF library for ERROR STOP -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43849