Opened 18 years ago

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

Attachment: patch-warning-dtors.diff added

The patch

Changed 18 years ago by danielk

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

comment:1 Changed 18 years ago by danielk

Mickaël, can you test the alternate patch?

comment:2 Changed 18 years ago by danielk

Milestone: 0.20

comment:3 Changed 18 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 18 years ago by Stuart Auchterlonie

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

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.