[GRASS-dev] G_OPT_* constants

Glynn Clements glynn at gclements.plus.com
Sat May 24 05:10:00 EDT 2008


GRASS GIS wrote:

>  IMPORTANT to all SVN users:
>  After the recent change in parser.c you need to RECOMPILE GRASS from
>  scratch.
> 
>  I wanted to post this but forgot about it. So
> 
>  {{{
>  make distclean
>  sh configure ...
>  make
>  }}}

Might it be better to just assign explicit values to the G_OPT_*
constants, so that this issue doesn't occur whenever new constants are
added or removed?

A related, but distinct option is to make e.g. G_gisinit() check that
the library and module were compiled with the same version of gis.h,
I.e.:

include/gis.h:

	int G__gisinit(const char *, const char *);
	
	#define GIS_H_VERSION "$Revision$"
	
	#define G_gisint(pgm) G__gisinit(GIS_H_VERSION, (pgm))

lib/gis/gisinit.c:

	int G__gisinit(const char *version, const char *pgm)
	{
		...
	
		if (strcmp(version, GIS_H_VERSION) != 0)
			G_fatal_error(_("Incompatible library version for module"));
	
		...
	}

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


More information about the grass-dev mailing list