Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#5204 closed Bugs (wontfix)

compile warning in serialization/extended_type_info.hpp on visual studio: c4265

Reported by: David Frink <david.frink@…> Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc: jonathan.jones@…

Description

class boost::serialization::extended_type_info generates warning c4265 with visual studio 2005, 2008, and 2010 because the destructor is not virtual, even though the class has virtual functions.

Looking at the class, I see that the warning was fixed only for gcc:

    // account for bogus gcc warning
    #if defined(__GNUC__)
    virtual
    #endif
    ~extended_type_info();

I believe the fix is to always declare the destructor virtual.

Change History (3)

comment:1 by Robert Ramey, 12 years ago

The reason this "virtual" is not necessary is that the destructor is protected so it cannot be called directly so there is no need to add a new member to the virtual function table. GCC doesn't have a convenient way to suppress bogus warnings so to avoid this warning I had to do this. This is basically the wrong thing to do but if I don't do it, I get complaints about "bugs" in the library. If you want to suggest the usaage of a praga or something for msvc - I'll put it in.

Robert Ramey

comment:2 by Robert Ramey, 11 years ago

Resolution: wontfix
Status: newclosed

comment:3 by Jonathan Jones <jonathan.jones@…>, 10 years ago

Cc: jonathan.jones@… added
Note: See TracTickets for help on using tickets.