Opened 9 years ago

#9691 new Bugs

Unused parameter 'args' in the definition of the macro BOOST_PARAMETER_FUNCTION

Reported by: Laurent Rineau <Laurent.Rineau__boost@…> Owned by: Daniel Wallin
Milestone: To Be Determined Component: parameter
Version: Boost 1.54.0 Severity: Problem
Keywords: patch Cc:

Description

In CGAL (www.cgal.org), usage of BOOST_PARAMETER_FUNCTION triggers several of such following warnings with recent g++ (4.8) and LLVM/clang:

CGAL-4.4-Ic-126/include/CGAL/perturb_mesh_3.h:39:1: warning: unused parameter 'args' [-Wunused-parameter]
BOOST_PARAMETER_FUNCTION(
^
/usr/local/include/boost/parameter/preprocessor.hpp:937:5: note: expanded from macro 'BOOST_PARAMETER_FUNCTION'
    BOOST_PARAMETER_FUNCTION_AUX(                                       \
    ^
/usr/local/include/boost/parameter/preprocessor.hpp:933:5: note: expanded from macro 'BOOST_PARAMETER_FUNCTION_AUX'
    BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER(name, args, 0, 0, tag_namespace)
    ^
/usr/local/include/boost/parameter/preprocessor.hpp:911:5: note: expanded from macro 'BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER'
    BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX( \
    ^
/usr/local/include/boost/parameter/preprocessor.hpp:899:21: note: expanded from macro 'BOOST_PARAMETER_FUNCTION_DEFAULT_LAYER_AUX'
      , Args const& args \
                    ^

I have verified that indeed the parameter is not used, and I propose that patch:

diff --git a/include/boost/parameter/preprocessor.hpp b/include/boost/parameter/preprocessor.hpp
index f1bda87..23ddbc4 100644
--- a/include/boost/parameter/preprocessor.hpp
+++ b/include/boost/parameter/preprocessor.hpp
@@ -896,7 +896,7 @@ struct funptr_predicate<void**>
     BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
     ResultType BOOST_PARAMETER_FUNCTION_DEFAULT_NAME(name)( \
         ResultType(*)() \
-      , Args const& args \
+      , Args const& \
       , int \
         BOOST_PARAMETER_FUNCTION_DEFAULT_ARGUMENTS( \
             BOOST_PARAMETER_FUNCTION_DEFAULT_FUNCTION_ARG \

Change History (0)

Note: See TracTickets for help on using tickets.