This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB 8.1 build error
On 04/27/2018 08:18 PM, Simon Marchi wrote:
> 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.
Oh, I had run into this in the past in context of an
empty struct and thought that the bug fix was for that
case only?
http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#253
Oh geez, I assumed that any_static_probe_ops was a POD with
function pointers, but now that I look, I see virtual
methods...
Anyhow.
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.
Not sure anymore. But in any case I have no problems with
the explicit initialization either.
Thanks,
Pedro Alves