Opened 19 years ago

Closed 19 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@… 19 years ago.
The patch
patch-warning-dtors-v2.patch (551 bytes ) - added by danielk 19 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)

by mythtv@…, 19 years ago

Attachment: patch-warning-dtors.diff added

The patch

by danielk, 19 years ago

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

comment:1 by danielk, 19 years ago

Mickaël, can you test the alternate patch?

comment:2 by danielk, 19 years ago

Milestone: 0.20

comment:3 by mythtv@…, 19 years ago

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 by Stuart Auchterlonie, 19 years ago

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 by danielk, 19 years ago

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.