[GRASS-dev] [GRASS GIS] #1676: clang: compile error in ami_stream

#1676: clang: compile error in ami_stream
-----------------------+----------------------------------------------------
Reporter: kyngchaos | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: 6.4.2
Keywords: | Platform: MacOSX
      Cpu: OSX/Intel |
-----------------------+----------------------------------------------------
When compiling with clang on OS X, there is a error in ami_stream.h:

{{{

In file included from ami_stream.cc:29:
/Users/Shared/src/GRASS/grass-6.4.2-snow/dist.i386-apple-
darwin11.3.0/include/grass/iostream/ami_stream.h:252:22: error:
       default arguments cannot be added to an out-of-line definition of a
member
       of a class template
                           AMI_stream_type st = AMI_READ_WRITE_STREAM) {
                                           ^ ~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/src/GRASS/grass-6.4.2-snow/dist.i386-apple-
darwin11.3.0/include/grass/iostream/ami_stream.h:470:26: error:
       default arguments cannot be added to an out-of-line definition of a
member
       of a class template
   ...MM_stream_usage usage_type= MM_STREAM_USAGE_OVERHEAD) {
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Shared/src/GRASS/grass-6.4.2-snow/dist.i386-apple-
darwin11.3.0/include/grass/iostream/ami_stream.h:549:62: error:
       default arguments cannot be added to an out-of-line definition of a
member
       of a class template
AMI_err AMI_STREAM<T>::read_array(T *data, off_t len, off_t *lenp=NULL) {
                                                              ^ ~~~~
}}}

note that gcc/g++ is not included with Xcode as of 4.3, and gcc/g++ are
symlinks to clang.

The llvm compiler is still included in Xcode 4.3, and ami_stream compiles
when configured with CC=llvm-gcc CXX=llvm-g++.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1676&gt;
GRASS GIS <http://grass.osgeo.org>

#1676: clang: compile error in ami_stream
-----------------------+----------------------------------------------------
Reporter: kyngchaos | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Default | Version: 6.4.2
Keywords: | Platform: MacOSX
      Cpu: OSX/Intel |
-----------------------+----------------------------------------------------

Comment(by glynn):

Replying to [ticket:1676 kyngchaos]:
> When compiling with clang on OS X, there is a error in ami_stream.h:
Fixed in trunk with r52130. Recommend back-port.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1676#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1676: clang: compile error in ami_stream
-----------------------+----------------------------------------------------
Reporter: kyngchaos | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: 6.4.2
Keywords: | Platform: MacOSX
      Cpu: OSX/Intel |
-----------------------+----------------------------------------------------
Changes (by martinl):

  * component: Default => Compiling

Comment:

Replying to [comment:1 glynn]:
> Replying to [ticket:1676 kyngchaos]:
> > When compiling with clang on OS X, there is a error in ami_stream.h:
> Fixed in trunk with r52130. Recommend back-port.

done in r52133 (devbr6) and r52134 (relbr64)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1676#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1676: clang: compile error in ami_stream
-----------------------+----------------------------------------------------
Reporter: kyngchaos | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: 6.4.2
Keywords: | Platform: MacOSX
      Cpu: OSX/Intel |
-----------------------+----------------------------------------------------

Comment(by kyngchaos):

It compiles now, thanks

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1676#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1676: clang: compile error in ami_stream
------------------------+---------------------------------------------------
  Reporter: kyngchaos | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.3
Component: Compiling | Version: 6.4.2
Resolution: fixed | Keywords:
  Platform: MacOSX | Cpu: OSX/Intel
------------------------+---------------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1676#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>