This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB 8.1 build error
On 2018-04-27 15:08, Pedro Alves wrote:
Oh, wait.... Your build line has no "-W" at all, it has "-w" instead??
How did that happen?
When --disable-build-warnings is used, we don't put any -W/-Wno- flags:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/warning.m4;h=f176a3291aa68acf0122609531abb4652425525b;hb=HEAD#l62
Right, that's ill-formed, thus a gdb bug. A const POD must either
be initialized, or have a user-declared default constructor.
So adding an explicit initializer like clang is suggesting should fix
it:
const any_static_probe_ops any_static_probe_ops = {};
In the stackoverflow answer I pointed to in my other messages talks
about a defect in the standard that was fixed. And it seems like the
compilers aligned with the new behavior. So is it really a GDB bug? In
any case, I have no problem adding the explicit initialization to be
friendly with older compilers.
Simon