[GRASS-dev] C and C++ standards used by GRASS
Glynn Clements
glynn at gclements.plus.com
Mon Mar 31 09:05:31 PDT 2014
Vaclav Petras wrote:
> > There are no standards for C++ code.
> >
>
> I would say that for GCC, we should go with:
>
> ‘c++98’‘c++03’
> The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
> additional defect reports. Same as -ansi for C++ code.
> (http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#C-Dialect-Options)
I'd suggest C++98 for C++ code, although whether you can get people to
follow it is another matter. The original version of r.terraflow
hard-coded the use of g++ in the Makefile.
> Hm, I hoped that I missed some -posix in GCC but there is apparently none.
> And if you are unsure about that -D options, I don't know how to enforce
> the right standards.
The precise details are platform-specific. In general, the use of
extensions is tolerated more in non-critical modules and less in core
libraries and critical modules.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list