mm.cc fails to build with GCC 4.7
mm.cc: In function 'void* operator new [](size_t)':
mm.cc:259:32: error: declaration of 'void* operator new [](size_t)' has a different exception specifier
In file included from mm.cc:29:0:
/builddir/build/BUILD/grass-6.4.1/dist.x86_64-redhat-linux-gnu/include/grass/iostream/mm.h:114:17: error: from previous declaration 'void* operator new [](std::size_t) throw (std::bad_alloc)'
mm.cc: In function 'void* operator new(size_t)':
mm.cc:310:30: error: declaration of 'void* operator new(size_t)' has a different exception specifier
In file included from mm.cc:29:0:
/builddir/build/BUILD/grass-6.4.1/dist.x86_64-redhat-linux-gnu/include/grass/iostream/mm.h:113:17: error: from previous declaration 'void* operator new(std::size_t) throw (std::bad_alloc)'
mm.cc: In function 'void operator delete(void*)':
mm.cc:362:32: error: declaration of 'void operator delete(void*)' has a different exception specifier
In file included from mm.cc:29:0:
/builddir/build/BUILD/grass-6.4.1/dist.x86_64-redhat-linux-gnu/include/grass/iostream/mm.h:115:15: error: from previous declaration 'void operator delete(void*) throw ()'
mm.cc: In function 'void operator delete [](void*)':
mm.cc:402:34: error: declaration of 'void operator delete [](void*)' has a different exception specifier
In file included from mm.cc:29:0:
/builddir/build/BUILD/grass-6.4.1/dist.x86_64-redhat-linux-gnu/include/grass/iostream/mm.h:116:15: error: from previous declaration 'void operator delete [](void*) throw ()'
make[3]: *** [OBJ.x86_64-redhat-linux-gnu/mm.o] Error 1
Change History
(5)
Keywords: |
libiostream r.terraflow gcc4.7 added
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Keywords: |
iostream gcc -fexceptions throw added
|
The log doesn't include the actual compilation command. Assuming that this is the issue originally reported in #1532, the command is:
I suspect that it's the -fexceptions which is causing the error. lib/iostream and r.terraflow neither throw nor catch exceptions, so there isn't actually any reason to use -fexceptions (either way, any exception will just terminate the program). OTOH, the exception specifications are part of the signature of the new and delete operators, so they should be present. Try r50130 from trunk; if there are no issues, it should be back-ported.