[GRASS5] r.sun bug
glynn.clements at virgin.net
Mon Feb 24 13:53:25 EST 2003
Eric G. Miller wrote:
> > > The latest version of r.sun contains the inline keyword in front of 3
> > > function definitions in main.c . But as far as I can make out this is a
> > > C++ keyword and doesn't work in C. It won't compile on IRIX anyway.
> > It works in gcc. Everyone uses gcc, right? ;)
> > 2. gcc extensions: gcc has many extensions (e.g. "inline", C++ "//"
> > comments, recently C9X), and many of them are enabled by default.
> Could add "-ansi" or "-std=iso9899:199409" (include 1994 amendments)
> to the CFLAGS for GCC. The "-ansi" flag disables "inline" and "//",
> but possibly also a few builtins that we'd want like "bzero" and "index"
> (though, those aren't really needed).
Unfortunately, "-ansi" also disables all of the feature test macros,
so you have to re-enable them manually, e.g.
CFLAGS='-g -ansi -D_BSD_SOURCE=1 -D_SVID_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=199506L'
_BSD_SOURCE and _SVID_SOURCE are sufficient for everything except
sigaction(), which also requires _POSIX_SOURCE.
However, using _GNU_SOURCE doesn't work, as sys/ucontext.h (included
by signal.h) and curses.h both try to define ERR.
The above CFLAGS setting works, and highlighted the "inline" error in
src/raster/r.sun/main.c, as well as the use of C++ comments in
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-dev