Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes/build warnings #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

ikmsk10
Copy link

@ikmsk10 ikmsk10 commented Jun 26, 2021

The PR solves the #104

  • Fix inherit base classes without virtual destructors
  • Prevent -Wunused-parameter warning.

Several classes might be inherited in end-web-applications, but these
haven't virtual destructors, which might lead to memory leaks.

* Add virtual destruct the bellow classes:
  + Manager_base
  + Mailer
  + Email_base; Email
  + Poll
  + Socket; SocketGroup
  + Transceiver
  + Connection
  + Curler
  + FcgiStreambuf

Testing: added `virtual` to the `EmailSender::response()` method of
`email.cpp` example for tesing reasons; build the examples targets with
`-Wnon-virtual-dtor` flag, and there are has no warnings.

Please, note, the `-Wnon-virtual-dtor` flag is not added to the
CMakeLists to be consistent for end-applications, which already uses the
`fastcgipp`.

End-user-impact: None.

Signed-off-by: Igor Kononenko <[email protected]>
End-user-impact: None.

Signed-off-by: Igor Kononenko <[email protected]>
@eddic
Copy link
Owner

eddic commented Sep 1, 2021

Hey Igor. I'm just getting to this now. Thanks for this pull request. This is very well done. A couple questions first though:

  • The [[maybe_unused]] attribute. This is listed as C++17. The fastcgi++ project is C++14 at this point. I'm a little worried about this but unsure. Will this effect backwards compatibility?
  • The virtual destructors you've added. For most of them the need is evident. Some, however, I am unclear on. I've always been a little leery about creating vtables for classes that aren't intended to be used polymorphically. Most of these already have vtables but I believe some do not. What are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants