help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] [PATCH] determine whether we are handling an error


From: Andrew Makhorin
Subject: Re: [Help-glpk] [PATCH] determine whether we are handling an error
Date: Fri, 06 Nov 2015 15:00:13 +0300

> Currently both normal messages and error messages are sent to stdout,
> which does not match usual usage of output streams.

The C standard does not require that. In my opinion, normal (usual)
terminal-based applications should not use stderr at all; only system
error messages (like segmentation fault, abort, etc.) should be sent
to stderr. The only case when stderr can be used for writing messages is
when application works like a filter reading a file from stdin and
writing its changed version to stdout. However, I find such approach
incorrect.

> 
> I propose to store the information if an error message is written in
> env->term_out and to use a new value GLP_ERROR = 2 to indicate an error
> message.
> 
> This value then should be used in glp_puts to decide if a message shall
> be sent to stdout or stderr.
> 
> An API function could be provided to read env->term_out. The return
> value could be used in the terminal hook function.
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]