[GRASS5] r.sun bug

Glynn Clements glynn.clements at virgin.net
Wed Feb 26 15:02:26 EST 2003


Paul Kelly wrote:

> > > CFLAGS='-g -ansi -D_BSD_SOURCE=1 -D_SVID_SOURCE=1 -D_POSIX_SOURCE=1 -D_POSIX_C_SOURCE=199506L'
> > >
> > > 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
> > > src/libes/dbmi/drivers/odbc/globals.h.
> >
> > Are there objections to hardcode above CFLAGS in 5.1 to
> > force pretty programming?
> 
> That is a nice idea but are they not gcc-specific flags? There is already
> a hard-coded -Wall in the GRASS 5.1 cflags which causes problems for non-gcc
> compilers (for information it should be -fullwarn for the IRIX cc). It probably
> shouldn't be too hard to make their inclusion specific to if gcc is detected;
> (just I don't know how to do it.)

The AC_PROG_CC autoconf macro sets the variable GCC to "yes" if the
C compiler is gcc.

However, the set of flags has to be compatible with any third-party
headers which GRASS uses, as well as GRASS itself. So, I recommend
that we don't add any unnecessary switches to CFLAGS.

Individual users can always force the use of specific flags if they
wish. So long as someone compiles the code with "-ansi ..." regularly,
most gcc-isms should be caught.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list