[GRASS-dev] G_OPT_* constants

Markus Neteler neteler at osgeo.org
Sat May 24 13:58:09 EDT 2008


On Sat, May 24, 2008 at 11:10 AM, Glynn Clements
<glynn at gclements.plus.com> wrote:
>
> 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"));
>
>                ...
>        }
>

Sounds like a very good suggestion to me. I got trapped by this
myself a couple of times in the past.

Markus


More information about the grass-dev mailing list