[GRASS-dev] [GRASS GIS] #2871: lib/iostream/mm.cpp:Fails to build with GCC 6: declaration of ... has a different exception specifier (was: Fails to build with GCC 6: declaration of ... has a different exception specifier)

GRASS GIS trac at osgeo.org
Mon Mar 7 23:35:19 PST 2016


#2871: lib/iostream/mm.cpp:Fails to build with GCC 6: declaration of ... has a
different exception specifier
------------------------+---------------------------------
  Reporter:  sebastic   |      Owner:  grass-dev@…
      Type:  defect     |     Status:  new
  Priority:  blocker    |  Milestone:  7.0.4
 Component:  Compiling  |    Version:  svn-releasebranch70
Resolution:             |   Keywords:  iostream
       CPU:  All        |   Platform:  Linux
------------------------+---------------------------------
Changes (by neteler):

 * priority:  normal => blocker
 * keywords:   => iostream
 * version:  7.0.2 => svn-releasebranch70
 * cpu:  Unspecified => All


Comment:

 (copied over from duplicate ticket 2956)

 I'm trying to build GRASS GIS 7.0.3 for various Fedora/EPEL versions using
 Fedora's COPR (chroot based compile environment).

 The following error appears:

 {{{
 make[5]: Leaving directory
 '/builddir/build/BUILD/grass-7.0.3/lib/python/imaging'
 make[4]: Leaving directory '/builddir/build/BUILD/grass-7.0.3/lib/python'
 make[3]: Leaving directory '/builddir/build/BUILD/grass-7.0.3/lib/python'
 make[3]: Entering directory
 '/builddir/build/BUILD/grass-7.0.3/lib/iostream'
 test -d OBJ.x86_64-redhat-linux-gnu || mkdir -p OBJ.x86_64-redhat-linux-
 gnu
 c++  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-
 gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
 -mtune=generic -fPIC  -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include    -DPACKAGE=\""grasslibs"\"
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -DRELDIR=\"lib/iostream\" -o OBJ.x86_64-redhat-linux-gnu/mm_utils.o -c
 mm_utils.cpp
 c++  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-
 gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
 -mtune=generic -fPIC  -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include    -DPACKAGE=\""grasslibs"\"
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -DRELDIR=\"lib/iostream\" -o OBJ.x86_64-redhat-linux-gnu/ami_stream.o -c
 ami_stream.cpp
 c++  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-
 gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
 -mtune=generic -fPIC  -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include    -DPACKAGE=\""grasslibs"\"
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -DRELDIR=\"lib/iostream\" -o OBJ.x86_64-redhat-linux-gnu/mm.o -c mm.cpp
 c++  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-
 gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
 -mtune=generic -fPIC  -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64
 -redhat-linux-gnu/include    -DPACKAGE=\""grasslibs"\"
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -I/builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-gnu/include
 -DRELDIR=\"lib/iostream\" -o OBJ.x86_64-redhat-linux-gnu/rtimer.o -c
 rtimer.cpp
 mm.cpp: In function 'void* operator new [](size_t)':
 mm.cpp:279:7: error: declaration of 'void* operator new [](size_t) throw
 (std::bad_alloc)' has a different exception specifier
  void* operator new[] (size_t sz) throw(std::bad_alloc) {
        ^~~~~~~~
 In file included from mm.cpp:49:0:
 /builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-
 gnu/include/grass/iostream/mm.h:132:17: note: from previous declaration
 'void* operator new [](std::size_t)'
    friend void * operator new[](size_t) throw(std::bad_alloc);
                  ^~~~~~~~
 mm.cpp: In function 'void* operator new(size_t)':
 mm.cpp:330:7: error: declaration of 'void* operator new(size_t) throw
 (std::bad_alloc)' has a different exception specifier
  void* operator new (size_t sz) throw(std::bad_alloc) {
        ^~~~~~~~
 In file included from mm.cpp:49:0:
 /builddir/build/BUILD/grass-7.0.3/dist.x86_64-redhat-linux-
 gnu/include/grass/iostream/mm.h:131:17: note: from previous declaration
 'void* operator new(std::size_t)'
    friend void * operator new(size_t) throw(std::bad_alloc);
                  ^~~~~~~~
 ../../include/Make/Compile.make:35: recipe for target 'OBJ.x86_64-redhat-
 linux-gnu/mm.o' failed
 make[3]: *** [OBJ.x86_64-redhat-linux-gnu/mm.o] Error 1
 make[3]: Leaving directory
 '/builddir/build/BUILD/grass-7.0.3/lib/iostream'
 }}}

 It happens both on i386/i686 and x86_64.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2871#comment:4>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list