[GRASS-dev] Re: [GRASS GIS] #308: Compiler error while building python swig

GRASS GIS trac at osgeo.org
Thu Sep 11 21:53:23 EDT 2008

#308: Compiler error while building python swig
  Reporter:  cgsbob               |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect               |      Status:  new                      
  Priority:  major                |   Milestone:  6.4.0                    
 Component:  SWIG (all bindings)  |     Version:  svn-develbranch6         
Resolution:                       |    Keywords:  python swig              
  Platform:  Unspecified          |         Cpu:  Unspecified              
Comment (by glynn):

 Replying to [comment:7 hamish]:

 > It happens that filtering out /^#/ also filters out any '#include
 <foo.h>' etc.
 > include/vect/dig_structs.h is the most diverse example of that, with
 #defined constants, structs, and #ifdef HAVE_OGR etc.
 > also include/Vect.h #includes the dig_*.h files in include/vect/,
 > should those be followed? stdio.h? grass/gis.h?

 The existing Makefile doesn't filter out preprocessor directives from
 Vect.h, only from gisdefs.h.

 Replying to [comment:8 hamish]:
 > fyi, "SWIG-1.3.12 and newer releases support variadic preprocessor

 We don't use variadic preprocessor macros, as they aren't allowed by ANSI
 C. The issue is whether the interface file should include variadic
 function declarations.

 It appears that the problem is with the __attribute__ declarations. If I
 #define __attribute__(x)
 at the top of gisdefs.i, gisdefs.h can be inserted in its entirety and
 nothing needs to be filtered out.

 But then there's the more fundamental problem that the other
 interfaces/*.i files are duplicating information from the headers, and are
 somewhat out of date. And it's safe to say that anything which attempts to
 duplicate information from the headers will be continually out of date.
 The SWIG stuff is going to have to use the actual headers directly.

Ticket URL: <http://trac.osgeo.org/grass/ticket/308#comment:9>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list