GDB 8.1 build error

Pedro Alves
Fri Apr 27 20:00:00 GMT 2018

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:
>> 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?

Oh geez, I assumed that any_static_probe_ops was a POD with
function pointers, but now that I look, I see virtual


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.

Pedro Alves

More information about the Gdb mailing list