[gdal-dev] Access SVN revision number from runtime?

Roger Bivand Roger.Bivand at nhh.no
Thu Aug 16 04:17:35 PDT 2012


On Thu, 16 Aug 2012, Even Rouault wrote:

>
>> The rgdal source is part C (for proj), part C++ for OGR/GDAL, but C++
>> written by C-minded people, so no new classes, but using C++ OGR/GDAL
>> classes, things like: pDataset->~GDALDataset();.
>
> Ah ok, so rgdal uses the GDAL C++ API (when feasable, the use of the C API is
> encouraged to avoid ABI issues).

This was Tim Keitt's design choice in 2002. On reflection, the C API might 
be an improvement, when time permits. Maybe a GSoC project next year!

>
> By the way pDataset->~GDALDataset() is a weird syntax. I've never used 
> that in any C++ code, so I am wondering if this completely destroys the 
> object. I suspect that the code of the destructor is called, but 
> potentially not its super destructor, so there must be a small memory 
> leak. Why not using delete pDataset, or better, to avoid cross-heap 
> issues on Windows, GDALClose((GDALDatasetH)pDataset) ?

Once again, Tim's choice. Thanks for the tip about alternatives!

>
>> As I understand you,
>> 1.x.a and 1.x.b share the C++ ABI, but say 1.x.b and 1.y.a will probably
>> not.
>
> Yes, 1.x.a and 1.x.b share the same C++ ABI, but other combinations 
> might not.
>
>>
>> This suggests that I may use GDALCheckVersion(GDAL_VERSION_MAJOR,
>> GDAL_VERSION_MINOR, NULL); to get something that might help users debug
>> performance failures, but that GDAL_VERSION_REV is too fine-grained.
>
> Yes.
>

Good, implemented and committed to SVN.

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the gdal-dev mailing list