[GRASS5] C and C++ compiler changes?

Laura Toma 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 
>>><X>.
>>>Also, the header strstream.h is deprecated, and should be replaced with 
>>>sstream.
>>>      
>>>
>
>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 
efficient code.

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
>>changed too!
>>    
>>
>
>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++.


-Laura
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20031022/840230c1/attachment.html


More information about the grass-dev mailing list