From 5a9e3bfd33ea55c7557a58dd282b2e1fa6f49908 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Wed, 13 Jul 2016 17:32:24 +1000 Subject: [PATCH] Enable Doxygen's WARN_AS_ERROR option Fixing all existing Doxygen warnings in the process. --- include/Doxyfile.in | 2 +- include/pcp-cpp/config.hpp | 7 +++++++ include/pcp-cpp/pmda.hpp | 18 +++++++++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/Doxyfile.in b/include/Doxyfile.in index 25c4858..fc225f9 100644 --- a/include/Doxyfile.in +++ b/include/Doxyfile.in @@ -743,7 +743,7 @@ WARN_NO_PARAMDOC = YES # a warning is encountered. # The default value is: NO. -WARN_AS_ERROR = NO +WARN_AS_ERROR = YES # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which diff --git a/include/pcp-cpp/config.hpp b/include/pcp-cpp/config.hpp index 905a033..2f30a08 100644 --- a/include/pcp-cpp/config.hpp +++ b/include/pcp-cpp/config.hpp @@ -98,4 +98,11 @@ inline char * get_pcp_runtime_version() PCP_CPP_END_NAMESPACE +/** + * @brief Let the compiler know that a parameter is unsed. + * + * @param name The name of the unused parameter. + */ +#define PCP_CPP_UNUSED(name) (void)name; + #endif diff --git a/include/pcp-cpp/pmda.hpp b/include/pcp-cpp/pmda.hpp index 351111b..62c9474 100644 --- a/include/pcp-cpp/pmda.hpp +++ b/include/pcp-cpp/pmda.hpp @@ -956,13 +956,15 @@ class pmda { * function will not be called for any metric that did not include * the `storable_metric` flag in the get_supported_metrics result. * - * @param metric_id The metric to store. - * @param value The value to store. + * @param metric The metric to store. + * @param value The value to store. * * @throw pcp::exception on error. */ - virtual void store_value(const metric_id &/*metric*/, const int &/*value*/) + virtual void store_value(const metric_id &metric, const int &value) { + PCP_CPP_UNUSED(metric) + PCP_CPP_UNUSED(value) throw pcp::exception(PM_ERR_PERMISSION); } @@ -978,14 +980,16 @@ class pmda { * function will not be called for any metric that did not include * the `storable_metric` flag in the get_supported_metrics result. * - * @param metric_id The metric to store. - * @param value The value to store. + * @param metric The metric to store. + * @param value The value to store. * * @throw pcp::exception on error. */ - virtual void store_value(const metric_id &/*metric*/, - const pmValueBlock * const /*value*/) + virtual void store_value(const metric_id &metric, + const pmValueBlock * const value) { + PCP_CPP_UNUSED(metric) + PCP_CPP_UNUSED(value) throw pcp::exception(PM_ERR_PERMISSION); }