[GRASS-dev] making grass modules less verbose

Glynn Clements glynn at gclements.plus.com
Fri Sep 22 12:12:56 EDT 2006


Brad Douglas wrote:

> > > A smaller issue is that of '\n'.  G_message("\n") doesn't work well and
> > > the alternative has been to use:
> > > 
> > > fprintf(stderr, "\n");
> > > 
> > > Going quiet may yield an extraneous number of CRs depending on the
> > > module...
> > 
> > Can you clarify.
> > 
> > G_message() ought to terminate anything it writes.
> 
> I was thinking of the many loops that output text.  After the loop is
> finished, there is usually a single CR after the loop:
> 
> fprintf(stderr, "\n");
> 
> For the loops that use fprintf() throughout, it won't be a major
> inconvenience (it just won't shut up :-), but for loops that use
> G_message(), you'll probably end up with a few extra CRs output to
> stderr...

Anything which is using fprintf(stderr, ...) should be changed to use
G_message() instead. Then the problem goes away, right?

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list