[GRASS-user] Compilation error in tonight's CVS

I just tried building CVS grass after a few weeks of not updating. I'm
on FreeBSD 5.4.

The error is in lib/gis/error.c, a complaint about an inconsistent definition
of write_error that doesn't match the prototype in the declaration earlier.

static int write_error (const char *, const int, const char *,
                        const int, const char *);

and later:
static int write_error (const char *msg, const int fatal,
                        const char *dir, const time_t clock,
                        const char *cwd)
{

In the definition clock is const time_t, in the declaration it's const int.
Apparently on FreeBSD they're not equivalent and the compiler chokes building
libgrass_gis. For whatever reason, this does *not* cause the entire make to
stop dead in its tracks --- it continues to try to build everything else,
and everything else fails to link because libgrass_gis can't be found.

Changing the declaration to have "const time_t" to match the definition
fixes the problem.

--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 SKCC#2002
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
one trick, rational thinking, but when you're good and crazy, oooh, oooh,
oooh, the sky is the limit!" --- The Tick

On Tue, Jun 06, 2006 at 11:55:42PM -0600, we recorded a bogon-computron collision of the <russo@bogodyn.org> flavor, containing:

I just tried building CVS grass after a few weeks of not updating. I'm
on FreeBSD 5.4.

The error is in lib/gis/error.c, a complaint about an inconsistent definition
of write_error that doesn't match the prototype in the declaration earlier.

static int write_error (const char *, const int, const char *,
                        const int, const char *);

Oops. The original is actually:

static int write_error (const char *, const int, const char *,
                         const long, const char *);

but the point is the same. that should be "const time_t" not "const long"
so that declaration and definition match even on systems where time_t isn't
actually a typedef for "long".

--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 SKCC#2002
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
one trick, rational thinking, but when you're good and crazy, oooh, oooh,
oooh, the sky is the limit!" --- The Tick

Tom Russo wrote:

I just tried building CVS grass after a few weeks of not updating. I'm
on FreeBSD 5.4.

The error is in lib/gis/error.c, a complaint about an inconsistent definition
of write_error that doesn't match the prototype in the declaration earlier.

static int write_error (const char *, const int, const char *,
                        const int, const char *);

and later:
static int write_error (const char *msg, const int fatal,
                        const char *dir, const time_t clock,
                        const char *cwd)
{

In the definition clock is const time_t, in the declaration it's const int.
Apparently on FreeBSD they're not equivalent and the compiler chokes building
libgrass_gis. For whatever reason, this does *not* cause the entire make to
stop dead in its tracks --- it continues to try to build everything else,
and everything else fails to link because libgrass_gis can't be found.

Changing the declaration to have "const time_t" to match the definition
fixes the problem.

Fixed in CVS.

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