mark unused attributes

This commit is contained in:
John
2023-12-26 10:50:48 +01:00
parent 8fdab797ca
commit 8ac8e59383
2 changed files with 15 additions and 3 deletions
+8 -2
View File
@@ -22,6 +22,12 @@
#include <string> #include <string>
#include <cstdint> #include <cstdint>
#if defined(__GNUC__)
#define MAYBE_UNUSED __attribute__((unused))
#else
#define MAYBE_UNUSED
#endif
namespace ebusd { namespace ebusd {
/** @file lib/knx/knx.h /** @file lib/knx/knx.h
@@ -160,7 +166,7 @@ class KnxConnection {
/** /**
* @param address the individual address to set. * @param address the individual address to set.
*/ */
virtual void setAddress(knx_addr_t address) { virtual void setAddress(MAYBE_UNUSED knx_addr_t address) {
// default implementation does nothing // default implementation does nothing
} }
@@ -176,7 +182,7 @@ class KnxConnection {
* Set the programming mode. * Set the programming mode.
* @param on true to start programming mode, false to stop it. * @param on true to start programming mode, false to stop it.
*/ */
virtual void setProgrammingMode(bool on) { virtual void setProgrammingMode(MAYBE_UNUSED bool on) {
// default implementation does nothing // default implementation does nothing
} }
}; };
+7 -1
View File
@@ -28,6 +28,12 @@
#endif // HAVE_SSL #endif // HAVE_SSL
#include "lib/utils/log.h" #include "lib/utils/log.h"
#if defined(__GNUC__)
#define MAYBE_UNUSED __attribute__((unused))
#else
#define MAYBE_UNUSED
#endif
namespace ebusd { namespace ebusd {
using std::string; using std::string;
@@ -171,7 +177,7 @@ void sslInfoCallback(const SSL *ssl, int type, int val) {
(type & SSL_CB_ALERT) ? SSL_alert_desc_string_long(val) : "?"); (type & SSL_CB_ALERT) ? SSL_alert_desc_string_long(val) : "?");
} }
int bioInfoCallback(BIO *bio, int state, int res) { int bioInfoCallback(MAYBE_UNUSED BIO *bio, int state, int res) {
logDebug(lf_network, logDebug(lf_network,
"SSL BIO state %d res %d", "SSL BIO state %d res %d",
state, state,