[GRASS5] Changes to src/libes/gis/env.c

Roger Bivand rsb at reclus.nhh.no
Wed Jul 12 03:26:07 EDT 2000


Hello Justin,

On Wed, 12 Jul 2000, Justin Hickey wrote:

> Hello Roger
> 
> On Jul 11,  1:59pm, Roger Bivand wrote:
> > Please note the (few) changes I made recently in env.c. They are related
> > to the ongoing discussion of the library API to libgis.a functions needed
> > by interfaces to other programs that link against libgis.a - the key thing
> > is never to expose an unprotected exit(); - always call
> > G_fatal_error(); first, so that any user-provided error handler is called
> > first, stopping say env.c functions clobbering the program linked to
> > libgis.a. env.c had a couple of bad exits, I hope I found the worst ones.
> 
> Yes, I saw your changes and will keep this advice in mind. Thank you for
> reminding me. I have one question though. I noticed that in some cases, there
> is a return statement after a call to G_fatal_error(), but G_fatal_error()
> contains a call to exit(). Therefore, is the return call just to keep the
> compiler happy, or is it there for another reason? I seem to remember getting
> hundreds of warnings about functions that had a return type but did not end in
> a return statement during compiling.
> 

Yes, that's the reason (not a good one, but -Wall helps find important
things, and when I drown in those kinds of warnings, I tend to miss the
tricky ones). Another is that G_set_error_routine() could (maybe) be used
to get round the G_fatal_error() exit - I'm not sure here though.

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.


---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list