[GRASS5] C and C++ compiler changes?
ltoma at bowdoin.edu
Wed Oct 22 10:08:50 EDT 2003
Bernhard Reiter wrote:
>On Tue, Oct 21, 2003 at 08:05:32PM +0200, Thierry Laronde wrote:
>>On Tue, Oct 21, 2003 at 01:22:57PM -0400, Laura Toma wrote:
>>>As far as I can tell all the compile problems with r.terraflow are
>>>because of the #include lines.
>>>With gcc3.2 and 3.3 all #include <X.h> should be replaced with #include
>>>Also, the header strstream.h is deprecated, and should be replaced with
>I'll take it this exclusively holds for C++?
>It would be interesting to get a pointer to the rationale behind it.
>Anyway this is a point where I'm glad that the tradition
>is to keep a lot of GRASS' code in plain C.
Yes, only for C++. It certainly is a pain to maintain C++ with the new
gcc 3.x, but there's no way around it..It's the price to pay for
The main reason r.terraflow is in C++ instead of C is templating. All
functions are templated and the type is determined at runtime, causing
the appropriate function to be instantiated. This is more efficient than
using void* in C, and also saves *a lot* of redundant code.
>>>In any case the code should be fixed to compile without warnings (and
>>>errors).. I'll be working on it.
>>Great. All I wanted to emphasize ---since I have spent some times trying
>>to convince GNU libc (latest) and GNU cc (latest) to compile smoothly
>>together...--- is that we are going to have some hard time with mixes
>>of different versions of gcc and glibc... And the C++ support has deeply
>Well it is _only_ about the C++ support as far as I always understood this.
>Mixing most of the plain C libraries have never been a major problem.
>Am I missing something?
yes, only for C++.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the grass-dev