Test failure in test_raster_no_projection

Bernhard Herzog bh at intevation.de
Mon Feb 7 15:38:19 CET 2005


Bernhard Reiter <bernhard at intevation.de> writes:

> On Mon, Feb 07, 2005 at 03:00:02PM +0100, Bernhard Herzog wrote:
>> After recompiling you should get a little farther, but the test probably
>> will still fail.  It fails for me, anyway, with an AssertionError:
>
> After recompilation it works for me.

I should have recompiled, too :) 
Now it works for me as well.


However, I had to modify gdalwarp.cpp a bit.  My gcc (2.95.4) doesn't
accept the syntax for macros with varargs used there.  Current gdalwarp
has this in line 138f:

  #define PYTHON_ERRF(n, str, ...) \
      {if (str != NULL) PyErr_Format(n, str, ## __VA_ARGS__);}

That's correct syntax for C99.  This syntax is not supported by gcc
2.95.4, though it apparently is in more recent versions.  In gcc 2.95, I
can use this gcc-specific form instead:

  #define PYTHON_ERRF(n, str, args...) \
      {if (str != NULL) PyErr_Format(n, str, ## args);}


However, I don't think we should be using C99 or gcc-specific things at
all, as it may cause portability issues.  I don't know whether the
Microsoft compiler accepts this, for instance (googling around suggests
it doesn't).  Also, gdalwarp.cpp is actually C++, and AFAICT variadic
macros are not part of the C++ standard yet.

I don't even think we need the PYTHON_ERRF in the first place.  The (str
!= NULL) check will always be true AFAICT, as the str parameter is a
string literal in all uses in gdalwarp.  We might as well call
PyErr_Format directly.

While we're at it: the PYTHON_ERR macro doesn't seem to be used at all,
so it should be removed.  It doesn't even seem to be doing something
useful.

Jonathan, do you have time to fix this?


   Bernhard

-- 
Intevation GmbH                                 http://intevation.de/
Skencil                                           http://skencil.org/
Thuban                                  http://thuban.intevation.org/




More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)