[Dune-devel] [Dune-Commit] [Commit] dune-common - e5ca9a3: [release] Removes unused parameter warnings with -Wall -Wextra

Markus Blatt markus at dr-blatt.de
Mon Dec 16 11:40:13 CET 2013


On Mon, Dec 16, 2013 at 09:37:22AM +0100, Markus Blatt wrote:
> On Mon, Dec 16, 2013 at 07:53:59AM +0100, Oliver Sander wrote:
> > isn't this why we have DUNE_UNUSED?  It makes for much better reading IMHO.
> 
> Which is undocumented and seems compiler specific.
> 
> Anyway in this case (of an unused function parameter):
> 
>      void deallocate(pointer p, size_type n)
>      {
> +      (void)n;
>        std::free(p);
>      }
> 
> The easiest way would have been to use
> -     void deallocate(pointer p, size_type n)
> +     void deallocate(pointer p, size_type /*n*/)
> 
> but this would have broken the doxygen documentation for the
> parameter n. Therefore I used this approach only for functions
> where there is no documentation.
> In the same sense I would assume that using
> 
> void deallocate(pointer p, DUNE_UNSED size_t n)
> 
> instead might have either also broken doxygen 

It does not break doxygen, but displays:


template<class T>
void Dune::MallocAllocator< T >::deallocate	(	pointer
p,
							DUNE_UNSED size_type	n 
		) 	   		
		inline

Which seems rather irritating, to me.

I will try to come up with something more literate compared to a void cast.

Markus

-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858  Fax: +49 (0)322 1108991658 




More information about the Dune-devel mailing list