[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 09:37:22 CET 2013


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 or the
the mind of the reader of the documentation. Not even sure whether
this might have worked as I did not test it.

But of course this approach is open for debate. If there is a better
way feel free to apply a patch.

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