Re: [PATCH][gdb] Fix -Wstrict-null-sentinel warnings

Simon Marchi
2020-02-10T14:08:21Z

On 2020-02-10 5:18 a.m., Tom de Vries wrote:
> [ was: Re: [PATCH][gdb] Mention CU offset for <artifical> if verbose ]
>
> On 09-02-2020 14:35, Tom Tromey wrote:
>>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>>
>> Tom> + debug_filename.reset (concat (artificial, "@",
>> Tom> + sect_offset_str (per_cu->sect_off), NULL));
>>
>> When passing NULL to concat, you either need nullptr or (char *) NULL.
>
> Fixed in attached patch.
>
> OK for trunk?

I think we usually put a space after the cast:

(char *) NULL

Also, if we want to enforce this warning, it should be added to gdb/warning.m4. Makefiles
in gdb/ and gdbserver/ should be re-generated. gdbsupport/ doesn't use AM_GDB_WARNINGS at
the moment.

Simon