[RFA 2/2] Make some dwarf_expr_context methods pure virtual
Pedro Alves
palves@redhat.com
Tue Oct 25 13:22:00 GMT 2016
On 10/24/2016 02:36 PM, Tom Tromey wrote:
>>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
>
> Ulrich> This seems to have broken my SPU daily build (running on RHEL 5 with a
> Ulrich> GCC 4.1 system compiler):
Any chance you could install the newer GCC from DTS on that machine?
Otherwise, if/when we go C++11, that builder will stop working.
> Ulrich> gdb/dwarf2expr.h:69: warning: 'struct dwarf_expr_context' has
> Ulrich> virtual functions but non-virtual destructor
>
> Ulrich> Is this a C++ version issue?
>
> I don't know. Adding a "virtual" to the destructor is safe though. I
> would do it but I'm traveling this week.
Looks like -Wnon-virtual-dtor was removed from (guessing) -Wall at some point.
With GCC 7 / trunk:
$ make WERROR_CFLAGS="-Wnon-virtual-dtor" dwarf2expr.o
...
In file included from .../src/gdb/dwarf2expr.c:28:0:
.../src/gdb/dwarf2expr.h:68:8: warning: ‘struct dwarf_expr_context’ has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
struct dwarf_expr_context
^~~~~~~~~~~~~~~~~~
I'll add the "virtual" in a bit.
Thanks,
Pedro Alves
More information about the Gdb-patches
mailing list