This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: RFC: gfortran on Windows - handling of no console / pausing before end-of-program console destruction
- From: NightStrike <nightstrike at gmail dot com>
- To: Daniel Franke <franke dot daniel at gmail dot com>
- Cc: Tobias Burnus <burnus at net-b dot de>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>
- Date: Mon, 27 May 2013 04:42:12 -1000
- Subject: Re: RFC: gfortran on Windows - handling of no console / pausing before end-of-program console destruction
- References: <5176B08F dot 4000203 at net-b dot de> <5769057 dot eZtlANuQVR at silence>
On Tue, Apr 23, 2013 at 7:52 AM, Daniel Franke <franke.daniel@gmail.com> wrote:
> On Tuesday 23 April 2013 18:02:23 Tobias Burnus wrote:
>> The following email is motivated by Lahey/GNU Fortran. Their gfortran
>> version is modified to do:
>>
>> "We added a couple of things to the compiler mainly to support
>> situations where the program has no console, or where the console is
>> created to run the program and is destroyed when the program terminates.
>> In the first case, changes were made to the Fortran runtime to test for
>> the existence of a console, and if there is none, publish errors via
>> message box. In the second case, we implemented an awkward "pause"
>> compiler feature that notifies the user that the program has terminated
>> execution, and to allow the user to inspect results before the console
>> is destroyed. This feature was partially written into the Fortran
>> runtime and partially in the mingw runtime, and only works when there is
>> a console present."
>>
>> Question to our Windows users: Does such a change or something similar
>> makes sense? (For MinGW/MinGW-w64 only - or also for Cygwin/Cygwin64?)
>> What kind of behaviour do you expect here?
>
> Hi Tobias.
>
> We regularly get "crash reports" from our users who double-click our console
> applications in Windows (MinGW). What happens: a temporary console opens, an
> error message like "missing file argument" is printed and the temporary
> console is immediately closed again. People often assume a crash here and do
> not know/understand that they should start cmd.exe first, then call the
> program to see the message (and eventually start reading the manual how to use
> it properly).
>
> A message box which gives the error messages from the console or just an
> "automated pause" to not close the console would certainly help those users -
> and probably not harm anyone else.
There used to be an option in the .PIF file to start a dos app from
windows that said something like "Close window on exit". I don't see
the equivalent option in a Windows 7 shortcut, but I'm sure there's
some way to get at it.
What I mean is, there's probably a very easy way to do this in user space.