Modify

Opened 12 years ago

Closed 12 years ago

#1992 closed patch (fixed)

Warning fixes

Reported by: mythtv@… Owned by: danielk
Priority: trivial Milestone: 0.20
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

This patche fixes a few "warning: ‘class XXX’ has virtual functions but non-virtual destructor"

Attachments (2)

patch-warning-dtors.diff (3.0 KB) - added by mythtv@… 12 years ago.
The patch
patch-warning-dtors-v2.patch (551 bytes) - added by danielk 12 years ago.
Less drastic fix, disable these bogus warnings. (those are interfaces, they don't need virtual dtors)

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by mythtv@…

The patch

Changed 12 years ago by danielk

Less drastic fix, disable these bogus warnings. (those are interfaces, they don't need virtual dtors)

comment:1 Changed 12 years ago by danielk

Mickaël, can you test the alternate patch?

comment:2 Changed 12 years ago by danielk

  • Milestone set to 0.20

comment:3 Changed 12 years ago by mythtv@…

The second patch works for me, but disabling such warnings is dangerous ! I don't think the gcc guys added this warning just for the fun. It may be ok to ignore them in this case (pure interface), but in other places we should expect destructors to not be called... and we won't have warnings to remind us any more. Adding the virtual destructors just forces subclasses to have virtual destructors, gcc is happy, and we can still be warned when necessary.

comment:4 Changed 12 years ago by stuarta

I'd vote for fixing the destructors. Here's some info from those who deal in reliable C++ coding

http://www.codingstandard.com/HICPPCM/Section_3.3_Class_Inheritance.html

and in particular

http://www.codingstandard.com/HICPPCM/Rule_3.3.2.html

comment:5 Changed 12 years ago by danielk

  • Resolution set to fixed
  • Status changed from new to closed

(In [10321]) Fixes #1992. Fixes compiler warning on interfaces using Martin Ebourne's fix.

Add Comment

Modify Ticket

Action
as closed The owner will remain danielk.
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.