From dee5b5e46423d6c77dccec5a6d17fb990099143e Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 16 Feb 2025 01:24:35 +0100 Subject: [PATCH 1/2] Prevent `-Wunused-parameter` warning --- include/fastcgi++/request.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fastcgi++/request.hpp b/include/fastcgi++/request.hpp index 80842c7..6f2a660 100644 --- a/include/fastcgi++/request.hpp +++ b/include/fastcgi++/request.hpp @@ -244,7 +244,7 @@ namespace Fastcgipp * @param[in] bytesReceived Amount of bytes received in this FastCGI * record */ - virtual void inHandler(int bytesReceived) + virtual void inHandler(int /*bytesReceived*/) {} //! Process custom POST data From 88150a1b98f4cc9ed6f5fe640f83b3c0f2910df7 Mon Sep 17 00:00:00 2001 From: Florian Date: Sun, 16 Feb 2025 01:39:53 +0100 Subject: [PATCH 2/2] Handle virtual destructor for base classes Apply C.35 recommendation of CppCoreGuidelines Testing: Build all the targets with `-Wnon-virtual-dtor` flag, and no error was raised --- include/fastcgi++/email.hpp | 2 ++ include/fastcgi++/manager.hpp | 2 +- include/fastcgi++/webstreambuf.hpp | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/fastcgi++/email.hpp b/include/fastcgi++/email.hpp index 406ee31..26f6b12 100644 --- a/include/fastcgi++/email.hpp +++ b/include/fastcgi++/email.hpp @@ -49,6 +49,8 @@ namespace Fastcgipp class Email_base { public: + virtual ~Email_base() = default; + //! %Email message data struct DataRef { diff --git a/include/fastcgi++/manager.hpp b/include/fastcgi++/manager.hpp index 153dba9..38f575b 100644 --- a/include/fastcgi++/manager.hpp +++ b/include/fastcgi++/manager.hpp @@ -70,7 +70,7 @@ namespace Fastcgipp */ Manager_base(unsigned threads); - ~Manager_base(); + virtual ~Manager_base(); //! Call from any thread to terminate the Manager /*! diff --git a/include/fastcgi++/webstreambuf.hpp b/include/fastcgi++/webstreambuf.hpp index ec0f272..cba650a 100644 --- a/include/fastcgi++/webstreambuf.hpp +++ b/include/fastcgi++/webstreambuf.hpp @@ -238,6 +238,8 @@ namespace Fastcgipp WebStreambuf(): m_encoding(Encoding::NONE) {} + + ~WebStreambuf() = default; }; }