[Dune] Exception specifier for *operator new in debugallocator

Christian Engwer christian.engwer at uni-muenster.de
Wed Oct 10 10:29:59 CEST 2012


Hi Christoph,

with a small test-prog I couldn't reproduce your problem. What are
your compiler flags?

Christian

On Wed, Oct 10, 2012 at 07:59:06AM +0200, Christoph Grüninger wrote:
> Good morning Dune, hi Christian,
> while doing "make check" I got an error stating "declaration [..]
> has a different exception specifier" in debugallocator.hh. Do the
> implementations differ? Or may I apply the attached patch, which
> solves the issue for me. Thou I suspect it will break the code for
> other compilers...
> 
> Bye
> Christoph
> 
> 
> The error message:
> 
> >In file included from testdebugallocator.cc:8:0:
> >../../../dune/common/debugallocator.hh: In function ‘void* operator new(size_t)’:
> >../../../dune/common/debugallocator.hh:288:54: error: declaration of ‘void* operator new(size_t) throw (std::bad_alloc)’ has a different exception specifier
> >In file included from /usr/include/c++/4.7/ext/new_allocator.h:34:0,
> >                 from /usr/include/c++/4.7/x86_64-suse-linux/bits/c++allocator.h:34,
> >                 from /usr/include/c++/4.7/bits/allocator.h:48,
> >                 from /usr/include/c++/4.7/vector:62,
> >                 from ../../../dune/common/debugallocator.hh:6,
> >                 from testdebugallocator.cc:8:
> >/usr/include/c++/4.7/new:93:7: error: from previous declaration ‘void* operator new(std::size_t)’
> 
> The patch:
> 
> Index: dune/common/debugallocator.hh
> ===================================================================
> --- dune/common/debugallocator.hh       (revision 7033)
> +++ dune/common/debugallocator.hh       (working copy)
> @@ -285,7 +285,7 @@
>  }
> 
>  #ifdef DEBUG_NEW_DELETE
> -void * operator new(size_t size) throw(std::bad_alloc)
> +void * operator new(size_t size)
>  {
>      // try to allocate size bytes
>      void *p = Dune::DebugMemory::alloc_man.allocate<char>(size);
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune

-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the Dune mailing list